diff options
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"); } |
