Results 1 to 2 of 2

Thread: [QGLWidget] Cannot bind texture

  1. #1
    Join Date
    Jan 2009
    Posts
    51
    Thanks
    28
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [QGLWidget] Cannot bind texture

    When I call
    Qt Code:
    1. bindTexture("./sprites/1.bmp");
    To copy to clipboard, switch view to plain text mode 
    I get this warning on output:
    QGLContext::bindTexture(): not a DDS image file.
    and texture doesn't appear.
    But when I call
    Qt Code:
    1. QPixmap pixmap("./sprites/1.bmp");
    2. bindTexture(pixmap);
    To copy to clipboard, switch view to plain text mode 
    everything works fine.
    What's wrong?

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QGLWidget] Cannot bind texture

    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..

  3. The following user says thank you to talk2amulya for this useful post:

    Macok (11th April 2009)

Similar Threads

  1. OpenGL texture on QGraphicsScene background
    By Ovnan in forum Qt Programming
    Replies: 5
    Last Post: 11th July 2008, 10:39
  2. QGLWidget : unable to texture a quad
    By yellowmat in forum Qt Programming
    Replies: 2
    Last Post: 4th November 2006, 16:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.