Results 1 to 5 of 5

Thread: Direct3D revisited

  1. #1
    Join Date
    Jun 2009
    Posts
    22
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Direct3D revisited

    I've understood that (experimental) support for Direct3D has been dropped . But what does this mean? Does it mean that the plan was that Qt optionally would do all drawing with Direct3D under Windows, and now it's not going to be like that? Or does it mean that there won't be any Direct3D equivalent to QGLWidget?

    It looks like QGLWidget is quite a thick binding to OpenGL. It's fully integrated with the rest of Qt and you can for example draw with Qpainter in a QGLWidget. Lets assume you don't require quite that much for Direct3D. You would be satisfied with a much thinner binding that would coexist with Qt but with a bare minimum of integration. What would be the least effort to accomplish that and what would be the best strategy to accomplish it. Qq is open source so maybe there's even an initiative going on to develop a "QD3DWidget"?

    I guess it would be most natural to inherit QWidget and try to somehow get hold of the underlying Win32 window. One probably could reuse much of the QGLWidget implementation. I note that Qt can interoperate with ActiveX. Could that be a better approach?

    If I go for Qt I'm going to use OpenGL. After all, portability is one of the major reasons for using Qt in the first place. The reason I'm asking is that I would feel more comfortable with a fall-back strategy in place. Direct3D has a strong presence and isn't going away anytime soon. I may never use it but I would like some indication as to what effort would be involved if I have to. This would also give an indication of how extendible Qt is.

    Thank you.
    Last edited by uj; 22nd February 2010 at 10:27.

  2. #2
    Join Date
    Jun 2009
    Posts
    22
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Direct3D revisited

    Any takers?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Direct3D revisited

    Quote Originally Posted by uj View Post
    But what does this mean? Does it mean that the plan was that Qt optionally would do all drawing with Direct3D under Windows, and now it's not going to be like that?
    Yes, that's exactly what it means. But Direct3D backend was never enabled in Qt directly so it doesn't make much difference, especially now that the OpenGL backend is quite mature and the raster engine has been improved significantly as well.
    [quote]Or does it mean that there won't be any Direct3D equivalent to QGLWidget?
    There never was one so that's correct as well. But you can use Direct3D in your application regardless. Qt simply won't aid you in it in any significant way.

    It looks like QGLWidget is quite a thick binding to OpenGL.
    Well... that's discussable

    It's fully integrated with the rest of Qt and you can for example draw with Qpainter in a QGLWidget.
    The latter is thanks to the OpenGL painting backend which translates all QPainter calls to OpenGL.

    What would be the least effort to accomplish that and what would be the best strategy to accomplish it. Qq is open source so maybe there's even an initiative going on to develop a "QD3DWidget"?
    Developing your own widget is one of the options but you can just set a bunch of flags on any widget telling Qt you will be responsible for drawing it and then just do regular D3D stuff (I know pretty much nothing about D3D so I can't tell you any details).

    If I go for Qt I'm going to use OpenGL. After all, portability is one of the major reasons for using Qt in the first place. The reason I'm asking is that I would feel more comfortable with a fall-back strategy in place. Direct3D has a strong presence and isn't going away anytime soon. I may never use it but I would like some indication as to what effort would be involved if I have to. This would also give an indication of how extendible Qt is.
    OpenGL will never go away as well so you needn't be concerned about it. After all it's a standard in 3D graphics.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Oct 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Direct3D revisited

    Hello,

    What flags do you set to tell QT not to handle painting of a widget? I'm doing a Direct3D class which draws correctly but the paintevent overwrites the screen. I'm
    using 4.6 on Windows CE on a Atom D510.

    Thanks,
    Thomas

  5. #5
    Join Date
    Feb 2007
    Posts
    49
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Direct3D revisited

    Flag Qt::WA_PaintOnScreen and reimplement QWidget::paintEngine to return 0.

Similar Threads

  1. Direct3D widget
    By ixSci in forum Qt Programming
    Replies: 19
    Last Post: 15th October 2009, 21:40
  2. [SOLVED] QDateTime (revisited)
    By pdoria in forum Qt Programming
    Replies: 1
    Last Post: 31st July 2009, 12:12
  3. QByteArray revisited
    By pdoria in forum Qt Programming
    Replies: 11
    Last Post: 17th January 2008, 18:09
  4. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.