From 6d4a5a40a08ec3a4bc451dee8fd62e89c8e0f409 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Wed, 1 Dec 2021 13:02:32 +0100 Subject: [PATCH] LibGL: Define `GL_ES_VERSION_2_0` GLES 2.0 is a subset of OpenGL, so we allow applications to compile against LibGL as if it fully supports GLES 2.0. Additionally, we set the definitions to an integer value of `1` so applications that check for availability like this... int main() { return GL_ES_VERSION_2_0; } ...can actually compile. At least ScummVM uses this, and Mesa defines their constants in the same way: https://gitlab.freedesktop.org/mesa/mesa/-/blob/44b9e11ddbb5f693e299fae034163e7687043862/include/GL/gl.h#L105 --- Userland/Libraries/LibGL/GL/gl.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index 3d26fa7180..9dcca68f56 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -15,12 +15,13 @@ extern "C" { # define GLAPI extern #endif -#define GL_VERSION_1_0 -#define GL_VERSION_1_1 -#define GL_VERSION_1_2 -#define GL_VERSION_1_3 -#define GL_VERSION_1_4 -#define GL_VERSION_1_5 +#define GL_VERSION_1_0 1 +#define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_VERSION_1_4 1 +#define GL_VERSION_1_5 1 +#define GL_ES_VERSION_2_0 1 // OpenGL related `defines` #define GL_TRUE 1