[Interest] How to know bindTexture failure

Calogero Mauceri mauceri at actgate.com
Fri Oct 5 17:21:45 CEST 2012

Il 05/10/2012 17.04, Samuel Rødal ha scritto:
> On 10/05/2012 04:46 PM, Calogero Mauceri wrote:
>> Hi,
>> is there a way to know programmatically whether the
>> QGLWidget::bindTexture function fails?
>> Sometime my bindTexture fails, I can see in the log file there is a line
>> reporting the binding failure:
>> texture upload failed, error code 0x500, enum: 3553 (de1)
> Hmm, looks like the error reporting is a bit lacking. If you have your
> own build of Qt you can uncomment the line that says #define
> QGL_BIND_TEXTURE_DEBUG in qgl.cpp to get more detailed debug output from
> the bind function.

Thanks Samuel for your reply.
We do have our own build of Qt, but I really would avoid to change them, 
it would be very difficult for us to keep our changes in sync with the 
new Qt distributions.

>> but the bindTexture returns a valid texture id (> 0) and the
>> glGetError() returns 0 (no error).
>> How do I know the binding has failed from my code?
> Yeah, glGetError() won't return an error since it clears the error state
> when it's called from within bindTexture().
> Btw, which OS and Qt version are you using?

I'm using Qt 4.7.3 on Windows, Linux and Mac.
I double checked the bindTexture source code on Qt 4.8 and there does 
not seem to be a different error handling than in 4.7 version :(

Calogero Mauceri
Software Engineer

Applied Coherent Technology Corporation (ACT)

More information about the Interest mailing list