void GLEScontext::init(GlLibrary* glLib) { if (!s_glExtensions) { initCapsLocked(s_glDispatch.glGetString(GL_EXTENSIONS)); s_glExtensions = new std::string(""); } if (!m_initialized) { initExtensionString(); int maxTexUnits = getMaxTexUnits(); m_texState = new textureUnitState[maxTexUnits]; for (int i=0;i<maxTexUnits;++i) { for (int j=0;j<NUM_TEXTURE_TARGETS;++j) { m_texState[i][j].texture = 0; m_texState[i][j].enabled = GL_FALSE; } } } }
void GLEScontext::init(const GLDispatch* dispatch) { m_glDispatch = dispatch; // TODO(digit): Make this thread-safe!! if (!s_glExtensions) { initCapsLocked(dispatch, dispatch->glGetString(GL_EXTENSIONS)); s_glExtensions = new std::string(""); } if (!m_initialized) { initExtensionString(); int maxTexUnits = getMaxTexUnits(); m_texState = new textureUnitState[maxTexUnits]; for (int i=0;i<maxTexUnits;++i) { for (int j=0;j<NUM_TEXTURE_TARGETS;++j) { m_texState[i][j].texture = 0; m_texState[i][j].enabled = GL_FALSE; } } } }