From 3fad375f5f868bc1b89079b173b9bfcdcf6a586d Mon Sep 17 00:00:00 2001 From: Andrew Willmott Date: Tue, 2 Apr 2019 16:07:28 +0100 Subject: [PATCH] ifdef freeglut extensions properly --- examples/example_freeglut_opengl2/main.cpp | 2 +- examples/imgui_impl_freeglut.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/example_freeglut_opengl2/main.cpp b/examples/example_freeglut_opengl2/main.cpp index f62c36d5..cc12e651 100644 --- a/examples/example_freeglut_opengl2/main.cpp +++ b/examples/example_freeglut_opengl2/main.cpp @@ -91,7 +91,7 @@ int main(int argc, char** argv) { // Create GLUT window glutInit(&argc, argv); -#ifndef __APPLE__ +#ifdef __FREEGLUT_EXT_H__ glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); #endif glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_MULTISAMPLE); diff --git a/examples/imgui_impl_freeglut.cpp b/examples/imgui_impl_freeglut.cpp index 61cab500..7054c378 100644 --- a/examples/imgui_impl_freeglut.cpp +++ b/examples/imgui_impl_freeglut.cpp @@ -72,7 +72,7 @@ void ImGui_ImplFreeGLUT_InstallFuncs() glutMotionFunc(ImGui_ImplFreeGLUT_MotionFunc); glutPassiveMotionFunc(ImGui_ImplFreeGLUT_MotionFunc); glutMouseFunc(ImGui_ImplFreeGLUT_MouseFunc); -#ifndef __APPLE__ +#ifdef __FREEGLUT_EXT_H__ glutMouseWheelFunc(ImGui_ImplFreeGLUT_MouseWheelFunc); #endif glutKeyboardFunc(ImGui_ImplFreeGLUT_KeyboardFunc); @@ -181,6 +181,7 @@ void ImGui_ImplFreeGLUT_MouseFunc(int glut_button, int state, int x, int y) io.MouseDown[button] = false; } +#ifdef __FREEGLUT_EXT_H__ void ImGui_ImplFreeGLUT_MouseWheelFunc(int button, int dir, int x, int y) { ImGuiIO& io = ImGui::GetIO(); @@ -191,6 +192,7 @@ void ImGui_ImplFreeGLUT_MouseWheelFunc(int button, int dir, int x, int y) io.MouseWheel -= 1.0; (void)button; // Unused } +#endif void ImGui_ImplFreeGLUT_ReshapeFunc(int w, int h) {