From 81f70e5b7c0267cf142ece59f7c11325ee55348d Mon Sep 17 00:00:00 2001 From: Andrew Willmott Date: Tue, 2 Apr 2019 12:47:14 +0100 Subject: [PATCH] Fixups for OSX --- examples/example_freeglut_opengl2/main.cpp | 8 +++++++- examples/imgui_impl_freeglut.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/example_freeglut_opengl2/main.cpp b/examples/example_freeglut_opengl2/main.cpp index c52dfe2a..f62c36d5 100644 --- a/examples/example_freeglut_opengl2/main.cpp +++ b/examples/example_freeglut_opengl2/main.cpp @@ -7,7 +7,11 @@ #include "imgui.h" #include "../imgui_impl_freeglut.h" #include "../imgui_impl_opengl2.h" -#include +#ifdef __APPLE__ + #include +#else + #include +#endif #ifdef _MSC_VER #pragma warning (disable: 4505) // unreferenced local function has been removed @@ -87,7 +91,9 @@ int main(int argc, char** argv) { // Create GLUT window glutInit(&argc, argv); +#ifndef __APPLE__ glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); +#endif glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_MULTISAMPLE); glutInitWindowSize(1280, 720); glutCreateWindow("Dear ImGui FreeGLUT+OpenGL2 Example"); diff --git a/examples/imgui_impl_freeglut.cpp b/examples/imgui_impl_freeglut.cpp index 32671a6d..61cab500 100644 --- a/examples/imgui_impl_freeglut.cpp +++ b/examples/imgui_impl_freeglut.cpp @@ -21,7 +21,11 @@ #include "imgui.h" #include "imgui_impl_freeglut.h" -#include +#ifdef __APPLE__ + #include +#else + #include +#endif #ifdef _MSC_VER #pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff) @@ -68,7 +72,9 @@ void ImGui_ImplFreeGLUT_InstallFuncs() glutMotionFunc(ImGui_ImplFreeGLUT_MotionFunc); glutPassiveMotionFunc(ImGui_ImplFreeGLUT_MotionFunc); glutMouseFunc(ImGui_ImplFreeGLUT_MouseFunc); +#ifndef __APPLE__ glutMouseWheelFunc(ImGui_ImplFreeGLUT_MouseWheelFunc); +#endif glutKeyboardFunc(ImGui_ImplFreeGLUT_KeyboardFunc); glutKeyboardUpFunc(ImGui_ImplFreeGLUT_KeyboardUpFunc); glutSpecialFunc(ImGui_ImplFreeGLUT_SpecialFunc);