Jump to content
  • Advertisement
Sign in to follow this  
Monkey_Missile

OpenGL Help moving from just SDL to SDL+openGL.

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

Hello I've been practicing coding on and off for awhile with C++ and SDL with the intention of making 2D games and have a fairly good grasp of it. However, SDL isn't the best for doing everything I want such as rotation so I want to move into openGL for a number of reasons. Does anyone know of some good documentation or tutorials that start with a blank project and build up to an SDL->openGL environment that includes loading images from file to be used by openGL and drawing them? This includes numerous file types like .PNG files and not just .BMP files.

Share this post


Link to post
Share on other sites
Advertisement
You can take a look at this website for information on getting started on using OpenGL with SDL http://www.libsdl.org/docs/html/guidevideoopengl.html

It uses immediate mode for the OpenGL examples which is now deprecated but the setup for using OpenGL with SDL is the same. The code is what I'm currently using in my engine. Basically you let SDL handle creation of an OpenGL context then use OpenGL for everything else. However I use the SDL buffer swap function still.

You'll want to use a library like GLEW to provide you the OpenGL function bindings along with SDL. The website I've linked uses glu instead, however I believe this is not up-to-date.

Hope this was helpful.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!