As a hobby, I experiment with OpenGL and write my own dumb engine with Qt + OpenGL. The latest success was the creation of the Entity System Framework, which could render a scene with shadows (from rendering to texture to RenderBuffer) with an attached physics engine (BulletPhysics).
After that, I upgraded to Qt 5.2 and was fully expressed by Qml (not trying to use it before). I experimented a bit with 2d qml graphics and decided to use qml for the user interface, but rejected the 2d project and returned to 3d. I created a new qml project, try to do some things under qml, as in the Example script - OpenGL under QML . After that, I moved my old code from a 3d project to a new project with a little refactoring (which should not affect anything).
At this moment I get tired of some strange mistake. It seems that the first frame is rendered as needed, but after that something goes wrong.
This is a slightly less normal frame (before any movement)
( ). qml. . , . - , , , .

, (? o_0) . qml. , .
(-Z)
qml, :
connect(window, &QQuickWindow::beforeRendering, this, &MyApp::renderScene, Qt::DirectConnection);
renderScene I:
OpenGL ( Qml, );
glViewport(0, 0, window->width(), window->height());
glClearColor(0, 0, 0, 1);
glClearDepth(1);
glDepthRange(0,1);
glDepthFunc(GL_LEQUAL);
BulletPhysics ( - )
- Render shadow map ( ) RenderBuffer ( 2048x2048, GL_DEPTH_COMPONENT24)
- RenderBuffer ( GL_RGBA8 GL_DEPTH_COMPONENT24 )
- Render two 2d quads - ( renderbuffer ) ( )
, . glGetError .
XY. -
:
( qml)
( )

?
: Qt Creator 3.0.0, Qt 5.2.0, Linux (Kubuntu 13.10) 64-, HD 7750
OpenGL: 3.3, 4.3 ( )
P.S. , , .