Results 1 to 20 of 27

Thread: Drawing standard widgets using a custom paint engine

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #26
    Join Date
    May 2007
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 2 Times in 1 Post

    Default Re: Drawing standard widgets using a custom paint engine

    Well I've got a simple Ogre widget, and a corresponding GraphicsView widget, along with a couple of subclasses for those implementing some more demonstrative functionality, and finally a simple demo app, mixing Qt and CEGUI (not sure why you'd want to in reality, but anyway...)

    If you're not interesting in building the Ogre demo, the most important bit of code to look at is probably in QOgreGLWidget::initializeGL().

    The idea is to get Ogre to use an existing window (which requires that you know its XVisualInfo), and to switch between QGLWidget and Ogre GLXContexts at the appropriate times so neither find themselves in an unexpected state.

    The final point is to ensure that both Ogre and Qt don't try to swap buffers; I let Qt do it so that the QGLWidget can get a chance to draw over the window after Ogre's done with that frame.

    Apologies for the roughness; I got bored of tidying it all up :P.

    Also, I think there was something else I was planning to add to this post, but it's two in the morning so I'll see if I remember tomorrow...
    Edit: I think it might have been that there's a bug in Ogre which this triggers. Nothing desperate - you get X Errors when the widget is destroyed; I've provided a patch.

    (Just noticed that CEGUI widgets, including the mouse cursor, are resized along with the window. Text correctly manages to remain the same size though and I'm performing the resize notifications to CEGUI in the same place, so I don't see what's wrong. Guess I must have missed something.)
    Attached Images Attached Images
    Attached Files Attached Files

  2. The following 2 users say thank you to Waywocket for this useful post:

    aMan (16th October 2007), desert (21st October 2010)

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.