Sign in to follow this  

SDL and OpenGL

This topic is 4866 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 want to draw a bitmap in OpenGL. Is there any way that I can load the bitmap using SDL and draw it using OpenGL? If this is not possible, then how else could I load a bitmap and display it in OpenGL?

Share this post


Link to post
Share on other sites
Yes, you can use SDL for this. Just use SDL's loadbmp function, then use the resultant image data (including height, width, and stride) for glTexImage2D.

Share this post


Link to post
Share on other sites
Go find the NeHe tutorial on textures and find the SDL+OpenGL port link at the bottom of the page. That will give you the full source on how exactly to do that.

here specifically (linux version):
http://nehe.gamedev.net/data/lessons/linuxsdl/lesson06.tar.gz

Share this post


Link to post
Share on other sites

This topic is 4866 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.

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