gloperate icon indicating copy to clipboard operation
gloperate copied to clipboard

Double initialization of render stage

Open j-o opened this issue 8 years ago • 1 comments

This call order is fine:

m_canvas->setOpenGLContext();
m_canvas->setRenderStage(...);

However, if called the other way around (as a result of my solution to #393), the render stage is initialized twice: once during setOpenGLContext() and once during the first call to render() (without intermediate deinitialization).

Solution ideas:

  • add m_contextInitialized flag to Canvas
  • Stage stores a pointer to the context it has been initialized with that can be checked by the Canvas

j-o avatar Aug 22 '17 07:08 j-o

I like the second idea because it just so happens that I have a Stage that needs this information anyway ;)

j-o avatar Aug 22 '17 07:08 j-o