PDA

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



lusius esox
05-26-2009, 03:05 AM
Hi!

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.

todayman
05-26-2009, 04: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, 05:34 AM
tnx ^^ moving the load() to initRendering solved it ^ ^ tnx.