View Full Version : A very VERY noobish question
02-03-2009, 05:52 AM
How to I draw images that are not simple pixel rectangles, like JPG, GIF, PNG, etc. ?
02-03-2009, 06:24 AM
with alpha blending. http://www.codesampler.com
02-03-2009, 06:43 AM
I'm not talking about alpha...for example, PNG is a compressed image. Does it need to be uncompressed or something? In other words, what is the difference between this and drawing a BMP file?
02-03-2009, 06:53 AM
The only difference is that the file format is more complex.
You always have to feed opengl with raw uncompressed texel data (unless you use DXTC formats).
If this sounds too complex for you, a lot of image loading libs exists for that purpose such as freeimage :
and devil :
Most of those formats store the image compressed. But with the appropiate libs, you don't have to do it your sefl. Here is an example with freeimage:
02-03-2009, 09:35 AM
sorry was way off. distracted by "pixel rectangles". basically you load the image file, read it values and uncompress this compress pixeldata to raw uncompressed memory where you then give them to OpenGL. on the uncompressed level all images are same, lots of pixel values made up of color channels.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.