From aabbeac3d9e2ac0f293ab43fec71e56091c823e8 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 18 Aug 2026 15:00:34 +0200 Subject: fix: macOS compatibility --- src/core/window.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core') 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"); } -- cgit v1.3