summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHill Ma <maahiuzeon@gmail.com>2022-08-07 11:46:02 -0700
committerHill Ma <maahiuzeon@gmail.com>2022-08-07 11:46:02 -0700
commitdfdb6e2db96f9b220883af2fc8a3fd53c617bc99 (patch)
tree8298d2e728bf6a34e8cc8c246e5c8348d9c26570
parenta1d96646c8ca28b99b2581dcfc4d74cc3b4de018 (diff)
downloadbullet3-dfdb6e2db96f9b220883af2fc8a3fd53c617bc99.tar.gz
Use OpenGL 3.3 core profile in eglCreateContext().
- Similar attributes are already used in GLFWOpenGLWindow.cpp. - This could avoid setting environment variables when using old Mesa where OpenGL compatibility profile is limited to 3.1.
-rw-r--r--examples/OpenGLWindow/EGLOpenGLWindow.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/OpenGLWindow/EGLOpenGLWindow.cpp b/examples/OpenGLWindow/EGLOpenGLWindow.cpp
index 52fc66c7f..a10f98082 100644
--- a/examples/OpenGLWindow/EGLOpenGLWindow.cpp
+++ b/examples/OpenGLWindow/EGLOpenGLWindow.cpp
@@ -248,8 +248,20 @@ void EGLOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
exit(EXIT_FAILURE);
}
+ EGLint egl_context_attribs[] = {
+ EGL_CONTEXT_MAJOR_VERSION,
+ 3,
+ EGL_CONTEXT_MINOR_VERSION,
+ 3,
+ EGL_CONTEXT_OPENGL_PROFILE_MASK,
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+ EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE,
+ EGL_TRUE,
+ EGL_NONE,
+ };
+
m_data->egl_context = eglCreateContext(
- m_data->egl_display, m_data->egl_config, EGL_NO_CONTEXT, NULL);
+ m_data->egl_display, m_data->egl_config, EGL_NO_CONTEXT, egl_context_attribs);
if (!m_data->egl_context)
{
fprintf(stderr, "Unable to create EGL context (eglError: %d)\n", eglGetError());