Results 1 to 3 of 3

Thread: Qt vs. OpenGL pixel format

  1. #1
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt vs. OpenGL pixel format

    More a recommandation for Qt developpers than a request for helping me.
    Qt offers QImage::Format_ARGB32 pixel fomat while OpenGL supports RGBA format! Could be nice in the future that Qt offers QImage::Format_RGBA32 format!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt vs. OpenGL pixel format

    Better send a suggestion to the Trolls.

  3. #3
    Join Date
    Jan 2006
    Posts
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Lightbulb Re: Qt vs. OpenGL pixel format

    ahoy,
    I think that OpenGL supports lots of formats to Draw or Read from the GPU color buffer, an example would be:
    Qt Code:
    1. somewhere in the ctor:
    2. QImage *pImg = new QImage(...);
    3.  
    4. ...
    5. then in
    6. void QGLWidget::paintGL(){
    7. glDrawPixels(pImg->width(), pImg->height(), GL_BGRA, GL_UNSIGNED_BYTE, pImg->bits());
    8. }
    To copy to clipboard, switch view to plain text mode 

    Notice the GL_BGRA format you can change that to many other formats when passing QImage::bits() to glDrawPixels without the need to do QGLWidget::convertToGLFormat( buf ). The same holds for passing the GPU color bit buffer to the main process buffer when doing glReadPixels. Doing so increases the painting (rendering) performance by staggering 10-15 folds.

    In brief adding more Image formats to QT is not bad idea but one may say it would be redundant.

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. Is there a known problem with QMimeData on Mac OS X?
    By Wurgl in forum Qt Programming
    Replies: 8
    Last Post: 27th February 2008, 22:21
  3. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  4. QPixmap pixel by pixel ?
    By tommy in forum Qt Programming
    Replies: 19
    Last Post: 3rd December 2007, 22:52
  5. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21

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.