Replace GL booleans with public macros

This commit is contained in:
Camilla Berglund
2015-08-23 19:30:04 +02:00
parent 13fbb4748a
commit 0eccf75f65
71 changed files with 581 additions and 557 deletions

View File

@@ -58,7 +58,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
switch (key)
{
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
case GLFW_KEY_V:

View File

@@ -46,9 +46,9 @@
static double cursor_x;
static double cursor_y;
static int swap_interval = 1;
static GLboolean wait_events = GL_FALSE;
static GLboolean animate_cursor = GL_FALSE;
static GLboolean track_cursor = GL_FALSE;
static int wait_events = GLFW_FALSE;
static int animate_cursor = GLFW_FALSE;
static int track_cursor = GLFW_FALSE;
static GLFWcursor* standard_cursors[6];
static void error_callback(int error, const char* description)
@@ -122,7 +122,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
if (glfwGetInputMode(window, GLFW_CURSOR) != GLFW_CURSOR_DISABLED)
{
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}

View File

@@ -35,7 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
static volatile GLboolean running = GL_TRUE;
static volatile int running = GLFW_TRUE;
static void error_callback(int error, const char* description)
{
@@ -61,7 +61,7 @@ static int thread_main(void* data)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
static float nrand(void)
@@ -116,7 +116,7 @@ int main(void)
glfwWaitEvents();
if (glfwWindowShouldClose(window))
running = GL_FALSE;
running = GLFW_FALSE;
}
glfwHideWindow(window);

View File

@@ -506,7 +506,7 @@ int main(int argc, char** argv)
{
char title[128];
slots[i].closeable = GL_TRUE;
slots[i].closeable = GLFW_TRUE;
slots[i].number = i + 1;
sprintf(title, "Event Linter (Window %i)", slots[i].number);

View File

@@ -69,7 +69,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_ESCAPE:
{
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}

View File

@@ -190,7 +190,7 @@ static void list_extensions(int api, int major, int minor)
putchar('\n');
}
static GLboolean valid_version(void)
static int valid_version(void)
{
int major, minor, revision;
glfwGetVersion(&major, &minor, &revision);
@@ -198,13 +198,13 @@ static GLboolean valid_version(void)
if (major != GLFW_VERSION_MAJOR)
{
printf("*** ERROR: GLFW major version mismatch! ***\n");
return GL_FALSE;
return GLFW_FALSE;
}
if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION)
printf("*** WARNING: GLFW version mismatch! ***\n");
return GL_TRUE;
return GLFW_TRUE;
}
static void print_version(void)
@@ -224,7 +224,7 @@ int main(int argc, char** argv)
{
int ch, api, major, minor, revision, profile;
GLint redbits, greenbits, bluebits, alphabits, depthbits, stencilbits;
GLboolean list = GL_FALSE;
int list = GLFW_FALSE;
GLFWwindow* window;
enum { API, BEHAVIOR, DEBUG, FORWARD, HELP, EXTENSIONS,
@@ -309,11 +309,11 @@ int main(int argc, char** argv)
break;
case 'd':
case DEBUG:
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
break;
case 'f':
case FORWARD:
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
break;
case 'h':
case HELP:
@@ -321,7 +321,7 @@ int main(int argc, char** argv)
exit(EXIT_SUCCESS);
case 'l':
case EXTENSIONS:
list = GL_TRUE;
list = GLFW_TRUE;
break;
case 'm':
case MAJOR:
@@ -444,13 +444,13 @@ int main(int argc, char** argv)
glfwWindowHint(GLFW_SAMPLES, atoi(optarg));
break;
case STEREO:
glfwWindowHint(GLFW_STEREO, GL_TRUE);
glfwWindowHint(GLFW_STEREO, GLFW_TRUE);
break;
case SRGB:
glfwWindowHint(GLFW_SRGB_CAPABLE, GL_TRUE);
glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
break;
case SINGLEBUFFER:
glfwWindowHint(GLFW_DOUBLEBUFFER, GL_FALSE);
glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_FALSE);
break;
default:
usage();
@@ -460,7 +460,7 @@ int main(int argc, char** argv)
print_version();
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
window = glfwCreateWindow(200, 200, "Version", NULL, NULL);
if (!window)

View File

@@ -65,7 +65,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
glfwIconifyWindow(window);
break;
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}
@@ -155,7 +155,7 @@ static GLFWwindow* create_window(GLFWmonitor* monitor)
int main(int argc, char** argv)
{
int ch, i, window_count;
GLboolean auto_iconify = GL_TRUE, fullscreen = GL_FALSE, all_monitors = GL_FALSE;
int auto_iconify = GLFW_TRUE, fullscreen = GLFW_FALSE, all_monitors = GLFW_FALSE;
GLFWwindow** windows;
while ((ch = getopt(argc, argv, "afhn")) != -1)
@@ -163,7 +163,7 @@ int main(int argc, char** argv)
switch (ch)
{
case 'a':
all_monitors = GL_TRUE;
all_monitors = GLFW_TRUE;
break;
case 'h':
@@ -171,11 +171,11 @@ int main(int argc, char** argv)
exit(EXIT_SUCCESS);
case 'f':
fullscreen = GL_TRUE;
fullscreen = GLFW_TRUE;
break;
case 'n':
auto_iconify = GL_FALSE;
auto_iconify = GLFW_FALSE;
break;
default:

View File

@@ -40,7 +40,7 @@
typedef struct Joystick
{
GLboolean present;
int present;
char* name;
float* axes;
unsigned char* buttons;
@@ -176,7 +176,7 @@ static void refresh_joysticks(void)
joystick_count++;
}
j->present = GL_TRUE;
j->present = GLFW_TRUE;
}
else
{

View File

@@ -78,7 +78,7 @@ static void framebuffer_size_callback(GLFWwindow* window, int width, int height)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
static void list_modes(GLFWmonitor* monitor)

View File

@@ -97,7 +97,7 @@ int main(int argc, char** argv)
printf("Requesting that MSAA not be available\n");
glfwWindowHint(GLFW_SAMPLES, samples);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
window = glfwCreateWindow(800, 400, "Aliasing Detector", NULL, NULL);
if (!window)

View File

@@ -63,7 +63,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_Q:
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}

View File

@@ -46,14 +46,14 @@ static void error_callback(int error, const char* description)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
static GLFWwindow* open_window(const char* title, GLFWwindow* share, int posX, int posY)
{
GLFWwindow* window;
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
window = glfwCreateWindow(WIDTH, HEIGHT, title, NULL, share);
if (!window)
return NULL;

View File

@@ -36,7 +36,7 @@
#include "getopt.h"
static GLboolean swap_tear;
static int swap_tear;
static int swap_interval;
static double frame_rate;
@@ -118,7 +118,7 @@ int main(int argc, char** argv)
float position;
unsigned long frame_count = 0;
double last_time, current_time;
GLboolean fullscreen = GL_FALSE;
int fullscreen = GLFW_FALSE;
GLFWmonitor* monitor = NULL;
GLFWwindow* window;
@@ -131,7 +131,7 @@ int main(int argc, char** argv)
exit(EXIT_SUCCESS);
case 'f':
fullscreen = GL_TRUE;
fullscreen = GLFW_TRUE;
break;
}
}

View File

@@ -44,7 +44,7 @@ typedef struct
thrd_t id;
} Thread;
static volatile GLboolean running = GL_TRUE;
static volatile int running = GLFW_TRUE;
static void error_callback(int error, const char* description)
{
@@ -87,7 +87,7 @@ int main(void)
if (!glfwInit())
exit(EXIT_FAILURE);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
for (i = 0; i < count; i++)
{
@@ -120,7 +120,7 @@ int main(void)
for (i = 0; i < count; i++)
{
if (glfwWindowShouldClose(threads[i].window))
running = GL_FALSE;
running = GLFW_FALSE;
}
}

View File

@@ -72,7 +72,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
}
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}
@@ -80,7 +80,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
int main(int argc, char** argv)
{
int i;
GLboolean running = GL_TRUE;
int running = GLFW_TRUE;
GLFWwindow* windows[4];
glfwSetErrorCallback(error_callback);
@@ -88,8 +88,8 @@ int main(int argc, char** argv)
if (!glfwInit())
exit(EXIT_FAILURE);
glfwWindowHint(GLFW_DECORATED, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
for (i = 0; i < 4; i++)
{
@@ -125,7 +125,7 @@ int main(int argc, char** argv)
glfwSwapBuffers(windows[i]);
if (glfwWindowShouldClose(windows[i]))
running = GL_FALSE;
running = GLFW_FALSE;
}
glfwPollEvents();