Open xinyazhang opened 9 years ago
I created a graphics device class and pass that to every scene object. Right now there is only one instance of GLCore
Current approach is not exactly what I wanted. SceneObj should only provide data and there will be another Renderer class actual calling the GL functions with the data provided by SceneObj.
By anyway, do whatever you like.
The reason I did the other way is that there might be variations of how scene objects need to be rendered. For example, I use glDrawArray for billboards, and use glDrawElements for general models and scenes. I understand what you said in the issue, but I felt this might become a little bit too restricted.
Currently each SceneObject inherits QOpenGLFunctions_3_3_Core, but this is wasteful. Try to refactor our current code to something like this:
Renderer --------(Read)--------> SceneObject +---------- Render according to data from SceneObject.