Jump to content
  • Advertisement
Sign in to follow this  
Ntvu

OpenGL + SDL

This topic is 3429 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 planning to create another game soon, probably in a month or so. My previous games were all created with C++ and SDL. SDL was used for graphics, input and sound. However, eventually I would like to be able to create a 3D game, and as far as I know SDL is not capable of rendering 3D graphics. Therefore I've decided that OpenGL may be a viable option for graphics. If I do use OpenGL and SDL for my next game, I will be using OpenGL for graphics and SDL for input and sound. I'm not sure whether to use GLUT or SDL for the windowing, but that's a very trivial problem. There are several reasons why I'm considering using SDL combined with OpenGL. The first reason is that I want the option of creating cross-platform games. I'm interested in creating games that run on multiple operating systems, including Windows, Macintosh and Linux. DirectX only runs on Windows, so I'm most likely not going to learn it. Also, I've developed games using SDL before, and from what I know, using SDL for input and sound is very simple. I would use SDL if it could render 3D graphics but unfortunately it can't, and that's why I'm considering using OpenGL. Do you think it could work, and have you ever used SDL + OpenGL for game development before? I read somewhere that it's a very powerful and flexible combination, and it is cross-platform as well. But I also want your comments and advice on this before I begin furthering my knowledge in the two API'S.

Share this post


Link to post
Share on other sites
Advertisement
I'd go for something like Ogre 3D, rather than raw OpenGL. It'll save you a lot of hassle, so you can focus on writing a game sooner. You can use SDL for input alongside it, too.

Share this post


Link to post
Share on other sites
SDL+OpenGL is a great combination and i have used it for my personal projects. Using OpenGL instead of SDL for rendering 2D games gives you access to all the greatness your video card has to offer. You get rotation, scaling, blending, etc., all for cheaper than it takes to render it in SDL without all of that. Of course, you are not limited to 2D. SDL isn't used in the rendering at all, just the windowing, input, and probably image loading.

The best way to dive right in is to go to the NeHe tutorials and download the source code for the first few examples. They have different download options and one of them is SDL+OpenGL.

It's also a great way to learn basic OpenGL.

Share this post


Link to post
Share on other sites
If you're gonna go with the raw OpenGL route, I would suggest you consider GLFW as an alternative to SDL. It offers the same benefits of being multiplatform, but I think it's a little more user friendly to get started with (especially when compared to GLUT, ugh).

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!