mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:02:55 +02:00
Support KHR_no_error in the VR context
This commit is contained in:
parent
72ec0ea29a
commit
05ba515c73
2 changed files with 6 additions and 7 deletions
|
@ -13,10 +13,7 @@
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
#include <EGL/eglext.h>
|
||||||
#if !defined(EGL_OPENGL_ES3_BIT_KHR)
|
|
||||||
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ovr;
|
using namespace ovr;
|
||||||
|
|
||||||
|
@ -129,7 +126,7 @@ void GLContext::doneCurrent() {
|
||||||
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLContext::create(EGLDisplay display, EGLContext shareContext) {
|
bool GLContext::create(EGLDisplay display, EGLContext shareContext, bool noError) {
|
||||||
this->display = display;
|
this->display = display;
|
||||||
|
|
||||||
auto config = findConfig(display);
|
auto config = findConfig(display);
|
||||||
|
@ -139,7 +136,9 @@ bool GLContext::create(EGLDisplay display, EGLContext shareContext) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE };
|
EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 3,
|
||||||
|
noError ? EGL_CONTEXT_OPENGL_NO_ERROR_KHR : EGL_NONE, EGL_TRUE,
|
||||||
|
EGL_NONE };
|
||||||
|
|
||||||
context = eglCreateContext(display, config, shareContext, contextAttribs);
|
context = eglCreateContext(display, config, shareContext, contextAttribs);
|
||||||
if (context == EGL_NO_CONTEXT) {
|
if (context == EGL_NO_CONTEXT) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct GLContext {
|
||||||
static EGLConfig findConfig(EGLDisplay display);
|
static EGLConfig findConfig(EGLDisplay display);
|
||||||
bool makeCurrent();
|
bool makeCurrent();
|
||||||
void doneCurrent();
|
void doneCurrent();
|
||||||
bool create(EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY), EGLContext shareContext = EGL_NO_CONTEXT);
|
bool create(EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY), EGLContext shareContext = EGL_NO_CONTEXT, bool noError = false);
|
||||||
void destroy();
|
void destroy();
|
||||||
operator bool() const { return context != EGL_NO_CONTEXT; }
|
operator bool() const { return context != EGL_NO_CONTEXT; }
|
||||||
static void initModule();
|
static void initModule();
|
||||||
|
|
Loading…
Reference in a new issue