Textures Problem and QImage Objects
-
Hi!
I have a weird problem here:
i have this code:
@
glEnable(GL_TEXTURE_2D);
glGenTextures( 1, &IdT );
glBindTexture(GL_TEXTURE_2D,IdT);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D,Formato,Altura,Largura,Formato,GL_UNSIGNED_BYTE,textura.bits());
@and i using a QImage class to load the image , and everything are working, but when i render the object the textures are not being rendered in the object (yes, i´m binding the texture first).
The weird thing is when i use my own routine to load the image it works fine...(with my own unsigned char pointer), but when i use the QImage Object, not.
I made tests with all types of project(Using WidGets and QWindows) and using All versions where this functions exists, and the only test the works loading the textures properly was when i use a Widget and bind the textures using the bindtexture method owned by GLWidget class.
How can i solve this?
Can anyone help me , please?Kind Regards.