Sign in to follow this  
nyrhinen

OpenGL Loading images with OpenGL

Recommended Posts

(I tried to search for a topic like this, honest!) I've read a couple of SDL+OpenGL -tutorials (thanks mates!) and I learned how to rotate a square. So now I'm wondering, that can I load images with OGL like with SDL (SDL_LoadBMP, or with the SDL_IMG-library, IMG_Load)? Because if it's possible to load images with OGL, then I could easily make a rotozoomer that rotates the image I loaded. And that's just what I need. :) Sorry if there is a topic like this, but I really tried to seach! And I Googled too!

Share this post


Link to post
Share on other sites
OpenGL is a 3D graphics API. Think of it as a abstraction to what your video card can do.
File formats is not covered by GL.
Libs like libjpeg and libpng can load (ie. decompress) images.
I suggest you use DevIL because it's easy to use and offers many file formats support.

You can create a texture with the decompressed RGB or RGBA image.

Use glTexImage2D or gluBuild2DMipmaps


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