Results 1 to 11 of 11

Thread: OpenGl 2d

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    122
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    16

    Default Re: OpenGl 2d

    Thanks for the sample code,
    I think that for having a good comparision with real system it would be necessary to load a different buffer everytime, I mean not from a file but from a sample buffer just like camera acquisition, so we could also check the memory transfer rate from RAM to the board.

    Anyway, I'm also looking at qpaintengine_opengl.cpp like Glitch suggested (Arthur painting system) and there the drawImage is implemented using textures and not glDrawPixels.

    In conclusion, Arthur painting system could be the solution for who wants to take advantage of using harware acceleration without learning OpenGL directly, unfortunately I can't find good examples for that and the documentations is not helpful.

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

    Default Re: OpenGl 2d

    Quote Originally Posted by Lele
    I'm trying to understand the best way to do such a 2d display,
    your use of glDrawPixels is interesting and very fast, and most of all doesn't need to have width and heigh power of 2.
    But unfortunately it seems to work differently than other OpenGL rendering, so it's not possible to zoom or resize like when using Texture.
    actually it is possible to use the zoom capability. check the QT documentation:

    void QGLWidget::resizeGL ( int width, int height ) [virtual protected]
    This virtual function is called whenever the widget has been resized. The new size is passed in width and height. Reimplement it in a subclass.
    There is no need to call makeCurrent() because this has already been done when this function is called.

    Quote Originally Posted by Lele
    So now I'm using
    gluBuild2DMipmaps( GL_TEXTURE_2D, 3, width, height,
    GL_RGB, GL_UNSIGNED_BYTE, data );

    and it's ok even because it automatically resize the width and heigh to be power of 2, but it's very slow if you do that at every frame
    re-implement resizeGL(newWidth,newHeight), and it should be ok.
    Quote Originally Posted by Lele
    So I just wanted to know if you're using drawpixel for showing a buffer without working on it (zoom, resize, overlays) or it was just a test.

    thanks
    there are different ways to do (zoom, resize, overlays), like some stuff could be easily done as QImage then you convert that to openGL and do some other stuff and so on..

    my inetntion of the test was to find the fastest way of rendering video frames (image sequences) after processing them, e.i. to find the fastest way of displaying the images.

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. Qt Embedded + OpenGL problem
    By EeroS in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 7th October 2008, 14:32
  3. QT + OpenGL + Thread => aaaahhhhh !
    By anthibug in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2008, 13:36
  4. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21
  5. OpenGL ES, Qt/11 - Qtopia Core?
    By zelko in forum Qt Programming
    Replies: 0
    Last Post: 3rd May 2007, 10:56

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.