PDA

View Full Version : Opengl - Textures - Qt



Alex63
29th June 2006, 09:56
Hello,

I 've made a game using Qt and opengl. I 'm using textures and when I run the game on my computer it works.
But when I 'm running the game on an other computer I seems that the textures aren't loaded. If I install Qt on the other computer it works.
Do you have any idea to avoid installing Qt ?
Maybe a .dll to put in the game directory...

Please help !

Alex

Here's my code to load textures :
QImage t;
QImage b;
b.load( "images/128.jpg" );
t = QGLWidget::convertToGLFormat( b );
glGenTextures( 2, &textures[0] );
glBindTexture( GL_TEXTURE_2D, textures[0] );
gluBuild2DMipmaps( GL_TEXTURE_2D, 3, t.width(), t.height(), GL_RGBA, GL_UNSIGNED_BYTE, t.bits() );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );

wysota
29th June 2006, 10:32
You might be missing a plugin for jpeg support. Make a subdirectory called imageformats in the directory containing the binary of your application and put the contents of your QTDIR/plugins/imageformats there.