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

@@ -91,7 +91,7 @@ typedef struct {float x; float y; float z;} vertex_t;
int width, height;
GLfloat deg_rot_y = 0.f;
GLfloat deg_rot_y_inc = 2.f;
GLboolean override_pos = GL_FALSE;
int override_pos = GLFW_FALSE;
GLfloat cursor_x = 0.f;
GLfloat cursor_y = 0.f;
GLfloat ball_x = -RADIUS;
@@ -236,7 +236,7 @@ void reshape( GLFWwindow* window, int w, int h )
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 void set_ball_pos ( GLfloat x, GLfloat y )
@@ -252,12 +252,12 @@ void mouse_button_callback( GLFWwindow* window, int button, int action, int mods
if (action == GLFW_PRESS)
{
override_pos = GL_TRUE;
override_pos = GLFW_TRUE;
set_ball_pos(cursor_x, cursor_y);
}
else
{
override_pos = GL_FALSE;
override_pos = GLFW_FALSE;
}
}

View File

@@ -219,7 +219,7 @@ void key( GLFWwindow* window, int k, int s, int action, int mods )
view_rotz += 5.0;
break;
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
case GLFW_KEY_UP:
view_rotx += 5.0;

View File

@@ -386,7 +386,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_ESCAPE:
/* Exit program on Escape */
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}
@@ -414,11 +414,11 @@ int main(int argc, char** argv)
if (!glfwInit())
exit(EXIT_FAILURE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL);
if (! window )

View File

@@ -875,7 +875,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_W:
wireframe = !wireframe;

View File

@@ -37,7 +37,7 @@ static void error_callback(int error, const char* description)
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);
}
int main(void)

View File

@@ -473,7 +473,7 @@ static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods)
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);
}

View File

@@ -278,7 +278,7 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
switch (key)
{
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
case GLFW_KEY_SPACE:
init_grid();