Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DIrectX to SDL: Input Handling

This topic is 5463 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''m coding a game of sorts and I''ve been using DirectX up till now for input and had intended to use it for music etc... I want the game to be platform independant however, and I''m having a few doubts about what to replace DX with. I''ve been to the website for SDL... I know that SDL does input handling (doesn''t it)? But it also does graphics (using OpenGL?). Can any experienced SDLers tell me if I start to use SDL, will I be stuck with it? i.e. will I have to make all my OpenGL calls with it, etc? Also is the sound and music sound of SDL pretty good? I will also have to convert my window handling code (from Win32), is SDL pretty good for window handling, message handling etc? I also know of GLUT and have used it frequently but does anyone think its really cut out to handle a game? (I hate callbacks). Lastly, about licensing, is it ok to comercially market a game made using SDL (as long as you include the object files with the release)? Thanks all who reply, I''m just a bit unsure about how to achieve platform independancy: i''m new to it.

Share this post

Link to post
Share on other sites
SDL does graphics on Windows platform using DirectDraw(6/7)(or uses the GDI if DX is not advailable). SDL primatives are fairly low level. For operations such as sprite rotation and alpha usage, a mixture of SDL+OpenGL would be suitable.

Using OpenGL along with SDL, you make most of your GL calls as usual(glVertexf,glDisable,...glColor,etc).

Plain SDL audio is very primative. It basically gives you a sound buffer to mix sounds in. You can always use another audio library such as BASS/fmod/openAL...Of course it would be good to use a sound library that is also platform independant.

Window and message handling is platform dependent and SDL hides it behind its own implementation. It does involve a message handling.

The ideal behind platform independance is to code the program once and recompile for each platform you want it on. OpengGL and SDL are both good cross-platform APIs/libs.

Share this post

Link to post
Share on other sites

  • 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!