Reputation: 25
How can I load an image in openGL? How can I transfer the image data to the data that openGL can understand?
Upvotes: 1
Views: 1295
Reputation: 39370
I'll break it into steps:
6. Profit!
Step 1, 2 and 3 can be easily changed to simple SOIL_load_texture
call, if you want to use SOIL image library.
Upvotes: 3
Reputation: 23550
First you have to decode the image into an RGBA-array. See here:
https://en.wikipedia.org/wiki/libpng
Then you have to map it to an OpenGL-texture and display:
http://nehe.gamedev.net/tutorial/texture_mapping/12038/
Upvotes: 1