View Full Version : [QGLWidget] Cannot bind texture

5th April 2009, 10:55
When I call
bindTexture("./sprites/1.bmp");I get this warning on output:
QGLContext::bindTexture(): not a DDS image file.and texture doesn't appear.
But when I call
QPixmap pixmap("./sprites/1.bmp");
bindTexture(pixmap);everything works fine.
What's wrong?

5th April 2009, 20:53
nothing's wrong :) bindTexture(QString ) actually expects a DDS file, the DirectDraw Surface file..there is a check inside for this kind of file..if its not, Qt throws a warning and returns from the function, thus nothing happens...where in the one where a pixmap is taken..that pixmap is converted to image which is further used to generate the texture which is then bound to the context..so better use bindTexture with image argument most of the time when u dont have dds image urself..if u have it..use the QString one..