From 851f9d5c1862cddb58d83b9deb79f5b9f405a69d Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Sat, 6 Jul 2024 17:38:39 +0200 Subject: [PATCH] glEnable(GL_MULTISAMPLE) commented out for OpenGL ES --- .../backend_impls/opengl_setup_helper/opengl_setup_glfw.cpp | 4 +++- .../backend_impls/opengl_setup_helper/opengl_setup_sdl.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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