Fix OpenGL ES build on SDL1

The preceding commit breaks OpenGLES + SDL1 support, by referencing
SDL_GL_* constants that are new in SDL2.  Add a preprocessor guard to
skip over the new constants when using SDL1.

Fixes: c90ac3e611 ("Fix OpenGL ES build on SDL2.")
This commit is contained in:
Kp 2022-10-02 19:47:24 +00:00
parent c90ac3e611
commit 9a8c49ccbf

View file

@ -794,9 +794,11 @@ void gr_set_attributes(void)
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, buffers);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, samples);
#else
#if SDL_MAJOR_VERSION == 2
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#endif
#endif
ogl_smash_texture_list_internal();
gr_remap_color_fonts();