Skip to content

Commit

Permalink
Merge branch 'unstable'
Browse files Browse the repository at this point in the history
  • Loading branch information
jarcode-foss committed Feb 8, 2018
2 parents 53bd657 + f5a9f80 commit be63f40
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions render.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
#include <glad/glad.h>
#include <GLFW/glfw3.h>

/* 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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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, {
Expand Down

0 comments on commit be63f40

Please sign in to comment.