Sign in to follow this  
Ntvu

OpenGL + SDL

Recommended Posts

Ntvu    100
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
Captain P    1092
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
leiavoia    960
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
shurcool    439
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this