summaryrefslogtreecommitdiff
path: root/src/sars.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-10-10 20:13:14 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-11-29 13:16:47 -0800
commita18c8c422d25fa96d3df96758a38e44f47514acb (patch)
tree95436a5f2afed05c566ec874cd0b337e0d90aac9 /src/sars.c
parente8a92941b0bf045fa7c330e759712968bd0c334e (diff)
*: 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
Diffstat (limited to 'src/sars.c')
-rw-r--r--src/sars.c8
1 files changed, 4 insertions, 4 deletions
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
© All Rights Reserved