fixed Linux error with the gamma variable already being defined in mathcalls.h

This commit is contained in:
zmertens
2015-05-22 20:25:46 -07:00
parent 349a95b997
commit 4018e023de

View File

@@ -35,7 +35,7 @@ GLfloat deltaTime = 0.0f;
GLfloat lastFrame = 0.0f; GLfloat lastFrame = 0.0f;
// Options // Options
GLboolean gamma = false; GLboolean gammaEnabled = false;
// The MAIN function, from here we start our application and run our Game loop // The MAIN function, from here we start our application and run our Game loop
int main() int main()
@@ -141,14 +141,14 @@ int main()
glUniform3fv(glGetUniformLocation(shader.Program, "lightPositions"), 4, &lightPositions[0][0]); glUniform3fv(glGetUniformLocation(shader.Program, "lightPositions"), 4, &lightPositions[0][0]);
glUniform3fv(glGetUniformLocation(shader.Program, "lightColors"), 4, &lightColors[0][0]); glUniform3fv(glGetUniformLocation(shader.Program, "lightColors"), 4, &lightColors[0][0]);
glUniform3fv(glGetUniformLocation(shader.Program, "viewPos"), 1, &camera.Position[0]); glUniform3fv(glGetUniformLocation(shader.Program, "viewPos"), 1, &camera.Position[0]);
glUniform1i(glGetUniformLocation(shader.Program, "gamma"), gamma); glUniform1i(glGetUniformLocation(shader.Program, "gamma"), gammaEnabled);
// Floor // Floor
glBindVertexArray(planeVAO); glBindVertexArray(planeVAO);
glBindTexture(GL_TEXTURE_2D, gamma ? floorTextureGammaCorrected : floorTexture); glBindTexture(GL_TEXTURE_2D, gammaEnabled ? floorTextureGammaCorrected : floorTexture);
glDrawArrays(GL_TRIANGLES, 0, 6); glDrawArrays(GL_TRIANGLES, 0, 6);
glBindVertexArray(0); glBindVertexArray(0);
std::cout << (gamma ? "Gamma enabled" : "Gamma disabled") << std::endl; std::cout << (gammaEnabled ? "Gamma enabled" : "Gamma disabled") << std::endl;
// Swap the buffers // Swap the buffers
glfwSwapBuffers(window); glfwSwapBuffers(window);
@@ -201,7 +201,7 @@ void Do_Movement()
if (keys[GLFW_KEY_SPACE] && !keysPressed[GLFW_KEY_SPACE]) if (keys[GLFW_KEY_SPACE] && !keysPressed[GLFW_KEY_SPACE])
{ {
gamma = !gamma; gammaEnabled = !gammaEnabled;
keysPressed[GLFW_KEY_SPACE] = true; keysPressed[GLFW_KEY_SPACE] = true;
} }
} }
@@ -247,4 +247,4 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{ {
camera.ProcessMouseScroll(yoffset); camera.ProcessMouseScroll(yoffset);
} }