@sinanmut When I create the 3D objects in the initializeGL function, it is fine paintGL function renders these objects. Later on when I want to add new objects to the scene I don't see these new ones being rendered by painGL function. Is there any flag that I have to add in paintGL fuinction or in initializeGL function?
Thanks,
SOLVED - I needed to unbind the vertex buffer at the end of my drawing function.
[ ... ]
glDrawArrays(GL_TRIANGLES, 0, 6);
glDisableVertexAttribArray(attribute_coord2d);
glBindBuffer (GL_ARRAY_BUFFER, 0);
painter->endNativePainting ();
vertexData() returns only the data in ram and not the real VBO which is stored in GPU-ram.
As soon as you mark it as dirty it gets completely copied into GPU.
Meanwhile I have implemented a direct opengl-way where I create the VBO myself.
Thanks anyway!
cu