Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: ninogenio on November 23, 2007

Title: in need of a bit of help with ogl textures
Post by: ninogenio on November 23, 2007
hey all,

ive been trying to get a simple texture loader/blitter class going but when i blit all i get is a white square and i cant for the life of me figuare out why?

i think its coming from the part where i push my image into vram but it looks like it should work.

if anyone can help out id be mighty chuffed cheers.

Title: Re: in need of a bit of help with ogl textures
Post by: Jim on November 23, 2007
Yeah, you need to create the sprite AFTER you initialise OpenGL.  Right now you have it at the top of WinMain - move it to much later on.

Jim
Title: Re: in need of a bit of help with ogl textures
Post by: ninogenio on November 23, 2007
cheers jim!

i cant believe i was being that daft  :whack:

i had to change it to GL_UNSIGNED_BYTE to get stop it crashing on my system but i thought GL_UNSIGNED_INT would work, not that it really makes much difference which one is used but i`m curious?
Title: Re: in need of a bit of help with ogl textures
Post by: Jim on November 23, 2007
INT means that each component of the colour is an int - ie, each r,g,b,a is 4x32 bits!
Jim
Title: Re: in need of a bit of help with ogl textures
Post by: ninogenio on November 23, 2007
ah right thanks jim!