Results 1 to 8 of 8

Thread: qt quick with opengl underlay

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qt quick with opengl underlay

    Yes, call the function.

    And you shouldn't access any of the window's properties from the rendering thread. Better initialize that scene before you start drawing.
    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.


  2. #2
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qt quick with opengl underlay

    Thanks,

    I have managed to render an opengl scene under the qt quick scene. I largely followed the tutorial titled - "Scene Graph - OpenGL Under QML"


    Now i want to animate the opengl scene that contains a teapot. I usually rotate the opengl scene using the Qt' s timer event and timer function as follows:

    Qt Code:
    1. QTimer *timer = new QTimer(this);
    2. connect(timer,SIGNAL(timeout()),this,SLOT(updateScene()));
    3. timer->start();
    To copy to clipboard, switch view to plain text mode 

    And inside the updateScene() slot I have the following :

    Qt Code:
    1. void GLWindow::updateScene()
    2. {
    3. float t = mTime.elapsed() * 0.001;
    4.  
    5. mScene->update(t);
    6.  
    7. paintGL();
    8. }
    To copy to clipboard, switch view to plain text mode 

    I used the same mechanism while integrating qt quick with opengl underlay, but the teapot only rotates for a while with the mouse click and it stops. I want the teapot to rotate continuously untill the application closes.

    Any hint to achieve this ?

    Thanks

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

    Default Re: qt quick with opengl underlay

    You have to tell QtQuick scene to update itself. It will call your GL code with the beforeRendering signal.
    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
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qt quick with opengl underlay

    Thanks !

    Any concrete example to what you have just mentioned ?

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

    Default Re: qt quick with opengl underlay

    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.


Similar Threads

  1. Replies: 2
    Last Post: 5th July 2017, 13:28
  2. Conversion from opengl to opengl es2 (Shapefile rendering)?
    By swapan_gh in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th December 2013, 06:59
  3. converting GLUT/OpenGL to Qt/OpenGL - displaying issue
    By yoti13 in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2012, 00:45
  4. Underlay map image in QwtPlot
    By MSUdom5 in forum Qwt
    Replies: 1
    Last Post: 5th May 2012, 01:51
  5. Qt with OpenGL ES for ARM9 - All OpenGL ES tests have failed!
    By vinpa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd December 2009, 10:10

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.