From 450896b122f869b33931ab3417c7cfcb2ecce9b9 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Thu, 24 Dec 2020 23:38:45 +0100 Subject: [PATCH] OpenGL version fix for shitty SoCs --- core/src/core.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/core.cpp b/core/src/core.cpp index a749ce51..83a1da25 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -161,10 +161,19 @@ int sdrpp_main(int argc, char *argv[]) { return 1; } +#ifdef __APPLE__ + // GL 3.2 + GLSL 150 + const char* glsl_version = "#version 150"; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac +#else + // GL 3.0 + GLSL 120 + const char* glsl_version = "#version 120"; + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); +#endif core::configManager.aquire(); int winWidth = core::configManager.conf["windowSize"]["w"]; @@ -230,7 +239,7 @@ int sdrpp_main(int argc, char *argv[]) { // Setup Platform/Renderer bindings ImGui_ImplGlfw_InitForOpenGL(window, true); - ImGui_ImplOpenGL3_Init("#version 150"); + ImGui_ImplOpenGL3_Init(glsl_version); if (!style::setDarkStyle(resDir)) { return -1; }