From 9a8c49ccbf039a253205302e1175e0cc46745486 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 2 Oct 2022 19:47:24 +0000 Subject: [PATCH] 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: c90ac3e611e482fb1ceada3e256039bf2ad96981 ("Fix OpenGL ES build on SDL2.") --- similar/arch/ogl/gr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/similar/arch/ogl/gr.cpp b/similar/arch/ogl/gr.cpp index a44b59534..6fe6b9a21 100644 --- a/similar/arch/ogl/gr.cpp +++ b/similar/arch/ogl/gr.cpp @@ -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();