Hi,
I’m trying to port some old renderer to be used in a small qml application. For that I’m using the TexturesInSGNode example (examples->quick->scenegraph->texturesinsgnode). I changed the logorenderer (under the shared folder) for that to just a very basic test. I removed everything from the initialize function (the renderer does not use shaders, just some simple glBegin-glEnd drawing) and the render function looks like this.
void LogoRenderer::render()
{
glClearColor(0.0f, 0.5f, 0.7f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
glPointSize(10.0f);
glBegin(GL_POINTS);
glVertex2i(0, 0);
glEnd();
}
void LogoRenderer::render()
{
glClearColor(0.0f, 0.5f, 0.7f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
glPointSize(10.0f);
glBegin(GL_POINTS);
glVertex2i(0, 0);
glEnd();
}
To copy to clipboard, switch view to plain text mode
When I render this, only the first frame is rendered correct (a red dot in the center of the qml component, but all frames after that are not rendered correct (nothing shown, just the clearcolor) (also it seems the Y-axis is flipped, but as I understand, this is normal).
When I comment the update() function in the QQuickFramebufferObject::Renderer render() function (in this render function before the update() function, the above logorenderer::render() function is called), the red dot is rendered correct, but the logorender::render() function is called only once, when i uncomment that update function, the logorender::render() function is called every frame, but then only the clearcolor is shown without the red dot. I’m sure I’m missing something very stupid, but I don’t know what…
Regards,
Matt
Bookmarks