EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *shareContext) { const egl::Config *config = mConfigSet.get(configHandle); gl::Context *context = glCreateContext(config, shareContext); mContextSet.insert(context); return context; }
EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *shareContext, bool notifyResets, bool robustAccess) { if (!mRenderer) { return NULL; } else if (mRenderer->testDeviceLost(false)) // Lost device { if (!restoreLostDevice()) return NULL; } gl::Context *context = glCreateContext(shareContext, mRenderer, notifyResets, robustAccess); mContextSet.insert(context); return context; }
EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *shareContext, bool notifyResets, bool robustAccess) { if (!mDevice) { if (!createDevice()) { return NULL; } } else if (testDeviceLost()) // Lost device { if (!restoreLostDevice()) return NULL; } const egl::Config *config = mConfigSet.get(configHandle); gl::Context *context = glCreateContext(config, shareContext, notifyResets, robustAccess); mContextSet.insert(context); mDeviceLost = false; return context; }
EGLContext Display::createContext(EGLConfig configHandle, EGLint clientVersion, const gl::Context *shareContext, bool notifyResets, bool robustAccess) { if (!mRenderer) { return EGL_NO_CONTEXT; } else if (mRenderer->testDeviceLost(false)) // Lost device { if (!restoreLostDevice()) { return error(EGL_CONTEXT_LOST, EGL_NO_CONTEXT); } } if (clientVersion > 2 && mRenderer->getMajorShaderModel() < 4) { return error(EGL_BAD_CONFIG, EGL_NO_CONTEXT); } gl::Context *context = glCreateContext(clientVersion, shareContext, mRenderer, notifyResets, robustAccess); mContextSet.insert(context); return success(context); }