Skip to content

Commit

Permalink
egl ogles bits in config request
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed May 4, 2024
1 parent 8537c8f commit 68b2858
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/ruisapp/glue/android/glue.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,16 @@ struct window_wrapper : public utki::destructable {
EGL_SURFACE_TYPE,
EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT,
// We cannot set bits for all OpenGL ES versions because on platforms which do not
// support later versions the matching config will not be found by eglChooseConfig().
// So, set bits according to requested OpenGL ES version.
[&ver = wp.graphics_api_version]() {
EGLint ret = EGL_OPENGL_ES2_BIT; // OpenGL ES 2 is the minimum
if (ver.major >= 3) {
ret |= EGL_OPENGL_ES3_BIT;
}
return ret;
}(),
EGL_BLUE_SIZE,
8,
EGL_GREEN_SIZE,
Expand Down
11 changes: 10 additions & 1 deletion src/ruisapp/glue/linux/glue_wayland.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,16 @@ struct window_wrapper : public utki::destructable {
EGL_SURFACE_TYPE,
EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT,
// We cannot set bits for all OpenGL ES versions because on platforms which do not
// support later versions the matching config will not be found by eglChooseConfig().
// So, set bits according to requested OpenGL ES version.
[&ver = wp.graphics_api_version]() {
EGLint ret = EGL_OPENGL_ES2_BIT; // OpenGL ES 2 is the minimum
if (ver.major >= 3) {
ret |= EGL_OPENGL_ES3_BIT;
}
return ret;
}(),
EGL_BLUE_SIZE,
8,
EGL_GREEN_SIZE,
Expand Down
11 changes: 10 additions & 1 deletion src/ruisapp/glue/linux/glue_xorg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,16 @@ struct window_wrapper : public utki::destructable {
EGL_SURFACE_TYPE,
EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT,
// We cannot set bits for all OpenGL ES versions because on platforms which do not
// support later versions the matching config will not be found by eglChooseConfig().
// So, set bits according to requested OpenGL ES version.
[&ver = wp.graphics_api_version]() {
EGLint ret = EGL_OPENGL_ES2_BIT; // OpenGL ES 2 is the minimum
if (ver.major >= 3) {
ret |= EGL_OPENGL_ES3_BIT;
}
return ret;
}(),
EGL_BLUE_SIZE,
8,
EGL_GREEN_SIZE,
Expand Down

0 comments on commit 68b2858

Please sign in to comment.