~SharedGLData() { GLContextDataMap::const_iterator end = glContextDataMap().end(); GLContextDataMap::iterator it; for (it = glContextDataMap().begin(); it != end; ++it) { if (it->second == this) break; } ASSERT(it != end); glContextDataMap().remove(it); }
~SharedGLData() { for (int i = SimpleProgram; i < ProgramCount; ++i) deleteShaderProgram(ShaderProgramIndex(i)); GLContextDataMap::const_iterator end = glContextDataMap().end(); GLContextDataMap::iterator it; for (it = glContextDataMap().begin(); it != end; ++it) { if (it->second == this) break; } ASSERT(it != end); glContextDataMap().remove(it); }
SharedGLData(GLContext glContext) { glContextDataMap().add(glContext, this); }
SharedGLData(GLContext glContext) : stencilIndex(1) { glContextDataMap().add(glContext, this); initializeShaders(); }