This sounds elementary but it is a pernicious showstopper for a critical project. Please give any help you can.
I’m now using QT 4.7 in the Qt SDK 1.1, building either with MSVC or MinGW, but have the same problem with 4.6 Open Source using MinGW. The OGL environment is created as a QGLWidget, and I am sourcing textures from QImages. My development platform is WinVista32 sp2 on an HP/AMD64 box with nVidia GeForce6150SE nForce430 graphics, driver 270.61 (latest)
In brief glTeximage2D() is either crashing or failing to load a usable texture, no matter what I do in the way of setup, plain or fancy. The simplest possible program fails just like my big app. But I have no clue why, or how to fix it.
void MinTexIMg::paintGL()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable( GL_TEXTURE_2D );
glPixelStorei( GL_UNPACK_ALIGNMENT, 4 ); // QImage to GPU
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA,
pim->width(), pim->height(), 0,
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
pim->bits());
glBegin( GL_QUADS );
glTexCoord2f( 0, 1 ); glVertex2f( -1, -1 );
glTexCoord2f( 1, 1 ); glVertex2f( 1, -1 );
glTexCoord2f( 1, 0 ); glVertex2f( 1, 1 );
glTexCoord2f( 0, 0 ); glVertex2f( -1, 1 );
glEnd();
}
pim -> a QImage with 32 bit BGRA pixels. The line
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
will only compile if I include glee.h (which I use in the app). If I do that, the call executes without an OGL error but the screen is white. The alternative
GL_BGRA_EXT, GL_UNSIGNED_INT,
is accepted with just the default Windows headers, but then the call segfaults in NtWaitForMultipleObjects on a secondary thread.
The identical code works perfectly in an older version of the app built with Qt 4.4 OpenSource.
Any ideas???