Jump to content
  • Advertisement
Sign in to follow this  
nyrhinen

OpenGL Loading images with OpenGL

This topic is 4371 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 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
Advertisement
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
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!