From a18c8c422d25fa96d3df96758a38e44f47514acb Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 10 Oct 2022 20:13:14 -0700 Subject: *: pivot everything to OpenGL ES 2.0 In the interests of keeping things bisectable this is one big commit of everything necessary to go from OpenGL 2.1 to OpenGL ES 2.0 in one fell swoop. There's a handful of annoying mechanical changes necessary in shaders like removing the 'f' suffix on float constants e.g. 1.f becomes 1.0 etc. This is primarily happening to enable emscripten builds --- src/sars.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sars.c') diff --git a/src/sars.c b/src/sars.c index 5f945ed..12e59bf 100644 --- a/src/sars.c +++ b/src/sars.c @@ -260,11 +260,11 @@ static void * sars_init(play_t *play, int argc, char *argv[], unsigned flags) /* TODO: add --fullscreen? */ } - fatal_if(SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY) < 0, + fatal_if(SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES) < 0, "Unable to set GL core profile attribute"); fatal_if(SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2) < 0, "Unable to set GL major version attribute"); - fatal_if(SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1) < 0, + fatal_if(SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0) < 0, "Unable to set GL minor version attribute"); fatal_if(SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) < 0, "Unable to set GL doublebuffer attribute"); @@ -326,8 +326,8 @@ static void * sars_init(play_t *play, int argc, char *argv[], unsigned flags) fatal_if(SDL_GL_SetSwapInterval(1) < 0, "Unable to enable vsync"); - fatal_if(!gladLoadGL(), - "Failed to initialize GLAD OpenGL extension loader"); + fatal_if(!gladLoadGLES2Loader(SDL_GL_GetProcAddress), + "Failed to initialize GLAD GLES 2.0 loader"); //This seems unnecessary now that the game grabs the mouse, //and it's undesirable with clickable UI elements outside the -- cgit v1.2.3