C++ and OpenGL or C++ and SDL

Started by
5 comments, last by assainator 14 years, 5 months ago
I've been doing some minor programming for a few years. Used BlitzBasic for a little while, but then I moved to C++. I wanted to try making a game from scratch with OpenGL and GLUT. Is it worth it to trudge through the textbooks and learn every aspect of 3D rendering, or am I better off just using something like SDL. I know GLUT doesn't have anything for audio playback in it, so I would have to use something like OpenAL. I'm starting to think I could save myself a lot of frustration by using SDL which has all the makin's for a game. Have any of you been in this situation? Should use SDL, but continue to read my OpenGL book? I believe SDL uses OpenGL for rendering. Is it possible to interact directly with OpenGL through SDL, even access the OpenGL Shader Language (I have no idea how to use this, it just sounds interesting and potentially very powerful.)
I'm learning C++ and Java at BCIT. I'm also trying to make 2D games with SDL and OpenGL.
Advertisement
SDL has two rendering modes. One is just to use SDL's rendering functions. In this case, the exact backend is dependent on your platform, but it probably won't be OpenGL *.

The second is to tell SDL to create an OpenGL rendering context. This is done by passing SDL_OPENGL to SDL_SetVideoMode(). In this case, you do all the drawing with raw OpenGL calls and use SDL just for window creation, context management and syncing (using SDL_GL_SwapBuffers). There are no restrictions, you are talking directly to OpenGL, you can use shaders etc.

I use the latter method, it works very well.

* Actually, the as-yet unreleased SDL 1.3 will support OpenGL as a direct backend. The API is heavily modified however.
Yeah, It seems like SDL is the best choice, In the past I have been using GLUT for window management and user input. SDL has a sound library as well which is good. And the ability to specifically talk to OpenGL is nice to have because all that money I spent on the OpenGL SuperBible won't go to waste. Thanks for the input fellas.
I'm learning C++ and Java at BCIT. I'm also trying to make 2D games with SDL and OpenGL.
I haven't done much with SDL yet, but the little I did used OpenGL for graphics (because I had done a little OpenGL before that). So it is definitely not an SDL OR OpenGL choice, it's the choice to use SDL or not really. I say give it a try, it is definitely 1 of the 5 most popular beginner game libraries and doesn't have too many major problems.
Might I suggest OpenGL + SFML?
==============================
A Developers Blog | Dark Rock Studios - My Site
Quote:Original post by Wavesonics
Might I suggest OpenGL + SFML?


+1 for SFML.
another +1 for SFML.
it is a great libary.
"What? It disintegrated. By definition, it cannot be fixed." - Gru - Dispicable me

"Dude, the world is only limited by your imagination" - Me

This topic is closed to new replies.

Advertisement