Jump to content
  • Advertisement
Sign in to follow this  
ukdeveloper

OpenGL Using OpenGL on top of SDL

This topic is 4841 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

Just a quick question, I've started looking at OpenGL, just to try something a little different. To make my life easier, I'm starting out using it on top of SDL. But my main concern is, are there any radical syntax differences between this and "ordinary" OpenGL? I wouldn't want to waste my time learning the SDL version if it differs too much from the version NeHe uses in his tutorials, or indeed an industrial standard of doing it. For example, you get things like
SDL_GL_SetAttribute();
etc. How does this differ from "ordinary" OpenGL? Should I just forget the SDL part and get a book/read NeHe to learn OpenGL on its own? Thanks, ukdeveloper.

Share this post


Link to post
Share on other sites
Advertisement
All SDL does is provide a display context for OpenGL do work in. After some setup, you just use normal OpenGL calls. SDL does not wrap the OpenGL API.

Share this post


Link to post
Share on other sites
For initialization, page flipping, some OpenGL settings, SDL gives a sort of layer on top of the normal GL API. But for the most part, you'll be hand-coding OpenGL lines of code as though you were writing a custom application.

I'd recommend sticking with SDL. If you follow similar other standards (ANSI-C for example) then the majority of your programs become compileable cross-platform, with very little need for OS-specific coding practises.

(That's not to say you won't have to change some code depending on if you're using Windows/Mac/Linux, but for the most part it's true.)

Not to mention, SDL is useful for many components of a game engine (sound, input, etc), which OpenGL by itself does not provide. If you're working on a "game" and not simply a "tech demo", then SDL is an indispensible tool.

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!