diff options
| author | hachem <im@hachem.wtf> | 2026-08-18 15:00:34 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-18 15:00:34 +0200 |
| commit | aabbeac3d9e2ac0f293ab43fec71e56091c823e8 (patch) | |
| tree | 4d986035f451e8511024076b2c94362dbf549712 /src/core/window.cpp | |
| parent | ecb6705c7fc4fb085184712567d0e936ea5d0d1f (diff) | |
fix: macOS compatibility
Diffstat (limited to 'src/core/window.cpp')
| -rw-r--r-- | src/core/window.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/window.cpp b/src/core/window.cpp index c1d714a..cb93d04 100644 --- a/src/core/window.cpp +++ b/src/core/window.cpp @@ -42,6 +42,13 @@ namespace Donut DONUT_INFO("GLFW initialized successfully"); } +#ifdef __APPLE__ + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); +#endif + m_window = glfwCreateWindow(m_width, m_height, m_title.c_str(), nullptr, nullptr); if (!m_window) { @@ -118,7 +125,9 @@ namespace Donut ImGuiIO& io = ImGui::GetIO(); io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; +#ifndef __APPLE__ io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; +#endif setup_im_gui_fonts(); ThemeManager::set_theme(Theme::Dark); @@ -131,7 +140,11 @@ namespace Donut } ImGui_ImplGlfw_InitForOpenGL(m_window, true); +#ifdef __APPLE__ + ImGui_ImplOpenGL3_Init("#version 150"); +#else ImGui_ImplOpenGL3_Init("#version 130"); +#endif DONUT_INFO("ImGUI initialized successfully"); } |
