[Qt-interest] texture issue
Sajjad
dosto.walla at gmail.com
Fri Aug 20 17:30:07 CEST 2010
Hello forum,
I have trying to build to build a mipmap and i am using a QImage to read the
image for the mipmaps.
But i am having no image getting wrapped on the quad.
**********************************************************
//function that load some common texture environement
//that will be shared by both the widgets
void SharedWidgetData::textureEnvironment()
{
//the last parameter in following function are saved in enum variables
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,textureMinFilter);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,textureMagFilter);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,textureWrapS);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,textureWrapT);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,textureEnv);
glTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_COLOR,textureEnvironmentColor);
glTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR,textureBorderColor);
//qDebug() << "Texture border color is set";
}
void SharedWidgetData::texture()
{
Q_ASSERT(textureImage != NULL);
textureEnvironment();
gluBuild2DMipmaps(GL_TEXTURE_2D,2,textureImage->width(),textureImage->height(),GL_RGB,GL_UNSIGNED_BYTE,textureImage->bits());
//qDebug() << "Mipmap is set";
}
**********************************************************
The above two functions are called in the initializeGL() and then in the
paintGL() function i have all the rendering operation defined with the
texture and vertex coordinates defined.
Any hint to track it why i am not having textured quad?
Regards
Sajjad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100820/ae2f49ef/attachment.html
More information about the Qt-interest-old
mailing list