[Qt-interest] Please help design a Qt framework for OpenGL

Joe Liu passer.by007gg at gmail.com
Mon Feb 1 14:42:19 CET 2010


Hi,

I know it's quite convenient to use QGLWidget to write your OpenGL app
within Qt;

However, my issue is to make a framework to do more control on FPS of OpenGL
Rendering by, maybe, utilizing QEventLoop;

We might use the following framework on plain Win32 APIs in an OpenGL app:
-----------------
int main()
{
    //init Window and OpenGL

    Messageloop
    {
       * if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
        else
        {
            // I can query system time to help control the FPS
            sysTime = timeGetTIme();
            if( sysTime - lastTime > 30 )
            {
                DrawGLScene();
                lastTime = sysTime;
            }
        }*
    }
}
-----------------

I think in Qt, maybe I need to use QEventLoop to control the message by
myself;
But I dont find useful docs or samples about the usage of QEventLoop, or
about controlling FPS;

Do you have any suggestions? Thanks a lot;

Cheers,


Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100201/e322ded1/attachment.html 


More information about the Qt-interest-old mailing list