From f5a9f801d19e9295d2db4d7e334bac4d7d91f4a4 Mon Sep 17 00:00:00 2001 From: Jarcode Date: Wed, 7 Feb 2018 20:56:41 -0800 Subject: [PATCH] Backported for GLFW 3.1, fixes #13, *again* --- render.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/render.c b/render.c index 5ad31bd..a774b18 100644 --- a/render.c +++ b/render.c @@ -16,6 +16,14 @@ #include #include +/* Fixes for old GLFW versions */ +#ifndef GLFW_TRUE +#define GLFW_TRUE GL_TRUE +#endif +#ifndef GLFW_FALSE +#define GLFW_FALSE GL_FALSE +#endif + #include "render.h" #include "xwin.h" #include "glsl_ext.h" @@ -742,6 +750,12 @@ struct renderer* rd_new(const char** paths, const char* entry, const char* force { .name = request, .fmt = "b", \ .handler = RHANDLER(name, args, { glfwWindowHint(attr, *(bool*) args[0]); }) } + #define STUB(request, f) \ + { .name = request, .fmt = f, \ + .handler = RHANDLER(name, args, { \ + fprintf(stderr, "warning: '%s' request is not implemented for this build\n", \ + request); }) } + struct request_handler handlers[] = { { .name = "setopacity", .fmt = "s", @@ -812,7 +826,11 @@ struct renderer* rd_new(const char** paths, const char* entry, const char* force WINDOW_HINT("setfloating", GLFW_FLOATING), WINDOW_HINT("setdecorated", GLFW_DECORATED), WINDOW_HINT("setfocused", GLFW_FOCUSED), + #if GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR <= 1 WINDOW_HINT("setmaximized", GLFW_MAXIMIZED), + #else + STUB("setmaximized", "b"), + #endif { .name = "setversion", .fmt = "ii", .handler = RHANDLER(name, args, {