Jump to content
  • Advertisement
Sign in to follow this  
karan13

Need Help with SDL and DirectX

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just started Game Programming and started to read Game Programming All in One which is really a good book. Now i made the whole game engine with it and made a breakout clone and understood it really well. I started to look for tutorials on the internet that would explain from start to finish how to code complete games. I found a couple but one of them started to talk about SDL. Now is SDL natively used. I understood what the website said about how it uses DirectX but should i just concentrate on programming in DirectX and forget SDL or how should I do it. The book never once talked about SDL so i am not sure what is different. Does that mean i would need to make changes to existing code like the 2d game engine that the book helped me design to make it work with SDL or what? Please let me know. Also i have been searching around, but i can't really find anything good. Does anybody know any tutorials or articles on how a programmer made a complete game from A to Z. I learn by practicing and making Breakout helped me learn a lot. I just wish there were other tutorials like that on the internet (I know they are but i can't find them). Thank You

Share this post


Link to post
Share on other sites
Advertisement
SDL is a cross-platform library. Under Windows, I believe it uses DirectX to do its magic. You talk to SDL, SDL talks to DirectX. Under Linux, it will use something different, but you still talk to SDL in the same way. One reason to use SDL over "straight" DirectX is that it simplifies everything to just a couple of lines of code to produce a window and get everything going, which is then the same code on any other platform you decide to build your app on.
As far as porting your code goes, yes, you will have to change it - you do not talk to DirectX in the same way as you talk to SDL.

@Kalasjniekof: You can use SDL to create a window from which you can use all the usual SDL functions (such as input event handling) but use OpenGL functions to render instead. In this case, it won't be rendering through SDL (it will be going straight through OpenGL) and won't touch DirectX.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!