diff --git a/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_glfw.cpp b/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_glfw.cpp index 05784178..c45e4986 100644 --- a/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_glfw.cpp +++ b/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_glfw.cpp @@ -59,7 +59,9 @@ namespace HelloImGui { namespace BackendApi if (effectiveSamples > 0) { - glEnable(GL_MULTISAMPLE); + #if ! defined(__EMSCRIPTEN__) && ! defined(HELLOIMGUI_USE_GLES3) && ! defined(HELLOIMGUI_USE_GLES2) + glEnable(GL_MULTISAMPLE); // multisampling is automatically enabled if the framebuffer supports it for for OpenGL ES + #endif glfwWindowHint(GLFW_SAMPLES, effectiveSamples); } else diff --git a/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_sdl.cpp b/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_sdl.cpp index feb3c52b..905e3b8b 100644 --- a/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_sdl.cpp +++ b/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_sdl.cpp @@ -73,8 +73,8 @@ namespace HelloImGui { namespace BackendApi { SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, effectiveSamples); - #ifndef __EMSCRIPTEN__ - glEnable(GL_MULTISAMPLE); + #if ! defined(__EMSCRIPTEN__) && ! defined(HELLOIMGUI_USE_GLES3) && ! defined(HELLOIMGUI_USE_GLES2) + glEnable(GL_MULTISAMPLE); // multisampling is automatically enabled if the framebuffer supports it for OpenGL ES #endif } else