I'm doing some pixels in OpenGL, and by the time I had to load a PNG, everything was getting better Was there. I got a thing called 'Deville', and after an example I found it displays something, but this is just a random rainbow. I am telling it right, as far as I can tell; I output the data into a text file to test it. I tried some other libraries, but they have a small building beyond their capabilities. Here's my setup:
(In the global area) Unsigned four pixel [160000 * 3]; ILubyte * Bytes; ((Main)) Illinois (); IlLoadImage ("test.png"); Size = ILGetInteger (IL_IMAGE_SIZE_OF_DATA); Bytes = ILGetData (); And here is my drawing routine:
// All beautiful colors for the screen (int i = 0; i <160000 * 3; ) {Pixels [I] = A; I ++; Pixels [ii] = b; I ++; Pixels [ii] = c; I ++; } // Break for PNG (Int i = 0; I & lt; size;) (if bytes [i + 3]! = 255) {i + = 4; continue;} pixel [i] = bytes [ I] + i ++; pixels [ii] = bytes [i] + i ++ pixels [i] = bytes [i] + i ++; i ++;} glDrawpixels (400, 300, gl_rgb, gl_unasIGNED_BYTE, Pixel); I know that the alignment is wrong; I'll fix it later. The problem is that the colors are not perfect
P.S. I know that you should use textured quads
Ng is a compressed format that looks like Aieljedetdata to use a pointer to a compressed data. Decoded Aielcopi pixels the image.
No comments:
Post a Comment