Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. [Solved] OpenGL Screen Update Too Slow (1 FPS!) is this a bug?
Forum Updated to NodeBB v4.3 + New Features

[Solved] OpenGL Screen Update Too Slow (1 FPS!) is this a bug?

Scheduled Pinned Locked Moved Game Development
2 Posts 1 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mkandel
    wrote on last edited by
    #1

    I am having some trouble with getting a Qt5 OpenGL update loop that runs at any reasonable rate.

    I have a widget embedded in a window that is, currently showing a texture. The add noise function fills the texture with a solid color.

    The FPS I am getting is about 1 frame per second.

    Does anybody have any suggestions for how to force Qt5 to update the OpenGL widget more often? Any code to post on how to this the right way?

    @GLWidget::GLWidget(QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
    {
    setAutoFillBackground(false);
    connect(&aTimer,SIGNAL(timeout()),this,SLOT(animate()));
    aTimer.start(100);
    }

    void GLWidget::animate()
    {
    //Logic for every time step
    addNoise();
    updateGL();
    }@

    I have also tried to call the update from the parent but I am experience a similar effect, specifically that it is not possible to set a QTimer for less than about 1 second. On the same machine windows native multimedia timers operate with 1 ms or better precision.

    When I have an @update@ command my window becomes unresponsive, but I can still see the frames updating and they are still not updating fast enough!
    @void GLWidget::paintGL()
    {
    //
    update();
    }@

    Is their some intrinsic limitation on the update rate? Does Qt ignore updates?

    I have also posted a public repo at
    @git clone https://bitbucket.org/FunFarm/qtcapturesoftware.git@

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mkandel
      wrote on last edited by
      #2

      http://stackoverflow.com/questions/14823364/qt-opengl-update-unusably-slow/14865984#comment20841445_14865984

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved