Updated source code to reflect content changes (code re-work): advanced OpenGL and model-loading.

This commit is contained in:
Joey de Vries
2017-05-31 23:12:15 +02:00
parent 70b789d3b9
commit 49d8d895ae
28 changed files with 116 additions and 71 deletions

View File

@@ -46,13 +46,13 @@ int main()
// glfw window creation
// --------------------
GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL);
glfwMakeContextCurrent(window);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
glfwSetCursorPosCallback(window, mouse_callback);
glfwSetScrollCallback(window, scroll_callback);
@@ -75,7 +75,7 @@ int main()
// build and compile shaders
// -------------------------
Shader shader("6.2.cubemaps.vs", "6.2.cubemaps.fs");
Shader skyboxShader("6.1.skybox.vs", "6.1.skybox.fs");
Shader skyboxShader("6.2.skybox.vs", "6.2.skybox.fs");
// set up vertex data (and buffer(s)) and configure vertex attributes
// ------------------------------------------------------------------
@@ -283,7 +283,6 @@ void processInput(GLFWwindow *window)
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
float cameraSpeed = 2.5 * deltaTime;
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS)
camera.ProcessKeyboard(FORWARD, deltaTime);
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS)
@@ -303,7 +302,6 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
glViewport(0, 0, width, height);
}
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)