Results 1 to 8 of 8

Thread: QImage bind texture fails

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QImage bind texture fails

    Quote Originally Posted by wysota View Post
    I would start with:
    Thank you. This solved the problem:
    Qt Code:
    1. void GlWidget::pixmapCatchFromForm(QByteArray bytes)
    2. {
    3. image->loadFromData(bytes, "PNG");
    4. texture = bindTexture(*image);
    5. qDebug() << texture; // returns 1
    6. updateGL();
    7. }
    To copy to clipboard, switch view to plain text mode 

    One thing I am very curious about is what keeps the CPU so busy. In my program, I have a timer which triggers every 40 ms, shoots screen and signals it to glWidget which is responsible for creating a texture from that screen shot. The program uses up to 90% of CPU. even without texturing! a simple timer and a screen shot grabWidget function takes up to 90%, I do not understand why!
    Last edited by saman_artorious; 19th September 2013 at 09:41.

Similar Threads

  1. [QGLWidget] Cannot bind texture
    By Macok in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2009, 19:53
  2. [mac] QImage.load fails
    By snoopy67 in forum Qt Programming
    Replies: 4
    Last Post: 7th November 2007, 14:06
  3. Texture in QGLWidget
    By showhand in forum Qt Programming
    Replies: 5
    Last Post: 28th October 2006, 08:47
  4. renderPixmap and texture
    By techno in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2006, 12:13

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
  •  
Qt is a trademark of The Qt Company.