1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

LibAccelGfx: Switch from OpenGL ES 2.0 to OpenGL 3.3

Desktop OpenGL 3.3 is currently supported by both EGL on Linux and
macOS.
This commit is contained in:
Aliaksandr Kalenik 2023-11-11 14:45:53 +01:00 committed by Andreas Kling
parent 2d12d1538d
commit 99caf4e649
2 changed files with 24 additions and 9 deletions

View file

@ -49,6 +49,12 @@ OwnPtr<Context> Context::create()
EGLint minor;
eglInitialize(egl_display, &major, &minor);
EGLBoolean ok = eglBindAPI(EGL_OPENGL_API);
if (ok == EGL_FALSE) {
dbgln("eglBindAPI failed");
VERIFY_NOT_REACHED();
}
static EGLint const config_attributes[] = {
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_BLUE_SIZE, 8,
@ -64,10 +70,15 @@ OwnPtr<Context> Context::create()
eglChooseConfig(egl_display, config_attributes, &egl_config, 1, &num_configs);
static EGLint const context_attributes[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 3,
EGL_NONE
};
EGLContext egl_context = eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, context_attributes);
if (egl_context == EGL_FALSE) {
dbgln("eglCreateContext failed");
VERIFY_NOT_REACHED();
}
EGLBoolean result = eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, egl_context);
if (result == EGL_FALSE) {