Results 1 to 2 of 2

Thread: QGraphicsScene into a GL/DirectX Texture

  1. #1

    Default QGraphicsScene into a GL/DirectX Texture

    I'd like to render a QGraphicsScene into a OpenGL or DirectX texture. I would like to do this without create a window, or QGraphicsView widget. I will have a window handle available. I was thinking that I could do this by overriding the paint function, and painting into a QImage buffer instead, and then copy that to the texture. I'm not entirely sure how to go about this. Does anyone have any ideas?

  2. #2

    Default Re: QGraphicsScene into a GL/DirectX Texture

    I think I've figured out how to do it.

    1) Create a ARGB8 Textute and QImage of the same size
    2) Create a QPainter for the QImage
    3) Render the scene into the image with QGraphicsScene::render()
    3) Copy the contents of the QImage into the texture

    My only thought is that because I'm using QGraphicsScene::render() I have to redraw the entire scene every frame, instead of only the stuff that changed.

Similar Threads

  1. Replies: 0
    Last Post: 5th March 2009, 06:54
  2. QPixmap display on QGraphicsScene
    By febil in forum Qt Programming
    Replies: 2
    Last Post: 26th February 2009, 09:27
  3. in QGraphicsScene matrix of other QGraphicsScene
    By Noxxik in forum Qt Programming
    Replies: 5
    Last Post: 15th February 2009, 17:27
  4. OpenGL texture on QGraphicsScene background
    By Ovnan in forum Qt Programming
    Replies: 5
    Last Post: 11th July 2008, 10:39
  5. QGLWidget : unable to texture a quad
    By yellowmat in forum Qt Programming
    Replies: 2
    Last Post: 4th November 2006, 16:47

Tags for this Thread

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.