wysota, I agree with you about paintGL(), but in my situation I'm not able to find another way.
Follows me:
I'm using OSG (OpenSceneGraph) which have to call a frame() method to generate a new frame at each time. This frame() must be called inside paintGL(): if I don't call the frame() inside paintGL() there are a lot of errors about openGL, shaders and graphics context.
So, I assume to have to call the frame() only inside the paintGL(). This is the main assumption and can be wrong but for now I have no other idea.
Now, if the 3D OSG scene is static there are no problems! The problems happens when the 3D OSG scene is dynamic and the reason is the next: if we modify the 3D OSG scene WHEN the frame() method running we probably receive a segmentation fault because we can't modify the OSG 3D tree when OSG designs it.
So, I need to implement a methodology to avoid this situation. So, when I have finished to modify the OSG 3D tree, I have to force the paintGL() method to call the frame() method and then return to modify the OSG 3D tree.
If I'm not able to understand when the frame() is finished (this means "when paintGL() is finished") I can't able to procede with 3D tree modifications. This is the reason for the semaphore inside paintGL().
Now, if you understand this situation, I think that the problem is inside the first assumption: we have to don't call the frame() inside paintGL() but I don't understand how.
This is a problem between QT and OSG and is diffult for me to find a solution.
Many thanks for any ideas.
Bye
Bookmarks