Need Help with SDL and DirectX

Started by
1 comment, last by benryves 18 years, 9 months ago
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
Advertisement
isnt SDL ogl only?
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.

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

This topic is closed to new replies.

Advertisement