Skip to content

Commit

Permalink
Merge pull request #4314 from mahiuchun/core
Browse files Browse the repository at this point in the history
Use OpenGL 3.3 core profile in eglCreateContext().
  • Loading branch information
erwincoumans authored Sep 25, 2022
2 parents dad061f + dfdb6e2 commit 327336d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion examples/OpenGLWindow/EGLOpenGLWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 327336d

Please sign in to comment.