mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-28 06:11:07 +00:00
Set GLFW_OPENGL_FORWARD_COMPAT on Mac OS to make samples work on that platform.
Fixed "Quit" menu option in glBatchViewer.
This commit is contained in:
parent
9af3edbbd3
commit
81d3955280
@ -693,6 +693,18 @@ reshape(int width, int height) {
|
||||
g_hud.Rebuild(width, height);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
#if GLFW_VERSION_MAJOR>=3
|
||||
void windowClose(GLFWwindow*) {
|
||||
g_running = false;
|
||||
}
|
||||
#else
|
||||
int windowClose() {
|
||||
g_running = false;
|
||||
return GL_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
static void
|
||||
#if GLFW_VERSION_MAJOR>=3
|
||||
@ -908,12 +920,11 @@ setGLCoreProfile()
|
||||
#if not defined(__APPLE__)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#else
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
#endif
|
||||
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -987,6 +998,7 @@ int main(int argc, char ** argv)
|
||||
glfwSetCursorPosCallback(g_window, motion);
|
||||
glfwSetMouseButtonCallback(g_window, mouse);
|
||||
glfwSetWindowSizeCallback(g_window, reshape);
|
||||
glfwSetWindowCloseCallback(g_window, windowClose);
|
||||
#else
|
||||
if (glfwOpenWindow(g_width, g_height, 8, 8, 8, 8, 24, 8,
|
||||
fullscreen ? GLFW_FULLSCREEN : GLFW_WINDOW) == GL_FALSE) {
|
||||
@ -999,6 +1011,7 @@ int main(int argc, char ** argv)
|
||||
glfwSetMousePosCallback(motion);
|
||||
glfwSetMouseButtonCallback(mouse);
|
||||
glfwSetWindowSizeCallback(reshape);
|
||||
glfwSetWindowCloseCallback(g_window, windowClose);
|
||||
#endif
|
||||
|
||||
#if defined(OSD_USES_GLEW)
|
||||
|
@ -1120,12 +1120,11 @@ setGLCoreProfile()
|
||||
#if not defined(__APPLE__)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#else
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
#endif
|
||||
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -1773,12 +1773,11 @@ setGLCoreProfile()
|
||||
#if not defined(__APPLE__)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#else
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
#endif
|
||||
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -1100,12 +1100,11 @@ setGLCoreProfile()
|
||||
#if not defined(__APPLE__)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#else
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
#endif
|
||||
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -1256,12 +1256,11 @@ setGLCoreProfile()
|
||||
#if not defined(__APPLE__)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#else
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
#endif
|
||||
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -1967,13 +1967,12 @@ setGLCoreProfile()
|
||||
#if not defined(__APPLE__)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#else
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
#endif
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -69,12 +69,11 @@ setGLCoreProfile()
|
||||
#if not defined(__APPLE__)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
#else
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
|
||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||
#endif
|
||||
|
||||
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user