View Full Version : Help with png & tga textures... =/ its all so blue

lusius esox
05-26-2009, 02:05 AM

I have tried to write a texture loader that loads PNG and TGA images into an opengl texture, the TGA loader failed and i thought my code was doin it wrong, but then i tried to write a PNG loader, and it came with the same annoying result:
A blue quad with no texture, =/

I would REALLY be glad if someone would check my code and see if it is something obvious thats missing.

http://m68k.se/ogl/textures.h <-- where the loader is, this is where the magic happens
http://m68k.se/ogl/main.c <- the main opengl funcs are located here.

05-26-2009, 03:17 AM
You should enable texturing outside of the begin/end section. It's actually not allowed to be in that section. I would just move them outside the section for now. The quad is blue because that's the current color when you draw it. Immediately before rendering the quad, set the color to white, so you can see the texture.

lusius esox
05-26-2009, 04:34 AM
tnx ^^ moving the load() to initRendering solved it ^ ^ tnx.