- usleep(20*1000);
- profilerTick(2);
- getBackend()->swapBuffers();
-// glDrawBuffer(GL_FRONT);
-// int xpos = 0;
-// int ypos = 0;
- //foreach (const QRect &r, region.rects()) {
- // convert to OpenGL coordinates
- //int y = displayHeight() - 0 - r.height();
-// glBitmap(0, 0, 0, 0, 0 - xpos, 0 - ypos, NULL); // not glRasterPos2f, see glxbackend.cpp
-// xpos = 0;
-// ypos = 0;
-// glCopyPixels(0, 0, getWidth(), getHeight(), GL_COLOR);
- //}
-// glBitmap(0, 0, 0, 0, -xpos, -ypos, NULL); // move position back to 0,0
-// glDrawBuffer(GL_BACK);
- profilerTick(3);
+ //////////////////////////////////////////////
+ profilerTick(statePresent);
+ if (copy) {
+ glDrawBuffer(GL_FRONT);
+ glCopyPixels(0, 0, getWidth(), getHeight(), GL_COLOR);
+ glDrawBuffer(GL_BACK);
+ }
+ else {
+ getBackend()->swapBuffers();
+ }
+ //////////////////////////////////////////////
+ profilerTick(statePostRender);