diff --git a/src/gui.cpp b/src/gui.cpp index bbcd03b6..1601161b 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -22,6 +22,10 @@ #include #endif +#if GLFW_VERSION_MINOR == 0 && GLFW_VERSION_REVISION <= 4 +#define OLD_GLFW_VERSION +#endif + namespace rack { static GLFWwindow *window = NULL; @@ -227,7 +231,9 @@ void guiInit() { // glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); // glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); +#ifndef OLD_GLFW_VERSION glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); +#endif std::string title = gApplicationName + " " + gApplicationVersion; window = glfwCreateWindow(1000, 750, title.c_str(), NULL, NULL); assert(window); @@ -254,7 +260,9 @@ void guiInit() { // GLEW generates GL error because it calls glGetString(GL_EXTENSIONS), we'll consume it here. glGetError(); +#ifndef OLD_GLFW_VERSION glfwSetWindowSizeLimits(window, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE); +#endif // Set up NanoVG gVg = nvgCreateGL2(NVG_ANTIALIAS);