|
|
@ -127,13 +127,13 @@ int main() { |
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
glViewport(0, 0, win.width(), win.height()); |
|
|
|
glViewport(0, 0, win.getWidth(), win.getHeight()); |
|
|
|
glfwSetFramebufferSizeCallback(win.win, framebuffer_size_callback); // Framebuffer
|
|
|
|
glfwSetFramebufferSizeCallback(win.getWindow(), framebuffer_size_callback); // Framebuffer
|
|
|
|
|
|
|
|
|
|
|
|
glEnable(GL_DEPTH_TEST); |
|
|
|
glEnable(GL_DEPTH_TEST); |
|
|
|
|
|
|
|
|
|
|
|
// Input
|
|
|
|
// Input
|
|
|
|
glfwSetInputMode(win.win, GLFW_CURSOR, GLFW_CURSOR_DISABLED); // Disable cursor
|
|
|
|
glfwSetInputMode(win.getWindow(), GLFW_CURSOR, GLFW_CURSOR_DISABLED); // Disable cursor
|
|
|
|
|
|
|
|
|
|
|
|
float borderColor[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
|
|
|
float borderColor[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
|
|
|
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); |
|
|
|
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); |
|
|
@ -152,21 +152,21 @@ int main() { |
|
|
|
Controller player(&win, glm::vec3(0.0f, 0.0f, 8.0f)); |
|
|
|
Controller player(&win, glm::vec3(0.0f, 0.0f, 8.0f)); |
|
|
|
scene.setCamera(&player); |
|
|
|
scene.setCamera(&player); |
|
|
|
|
|
|
|
|
|
|
|
while (!glfwWindowShouldClose(win.win)) { |
|
|
|
while (!glfwWindowShouldClose(win.getWindow())) { |
|
|
|
// Handle input
|
|
|
|
// Handle input
|
|
|
|
player.processInput(scene.deltaTime); |
|
|
|
player.processInput(scene.deltaTime); |
|
|
|
processInput(win.win); |
|
|
|
processInput(win.getWindow()); |
|
|
|
|
|
|
|
|
|
|
|
ro.translate(glm::vec3(0.0f, 0.0f, 0.001f)); |
|
|
|
ro.translate(glm::vec3(0.0f, 0.0f, 0.001f)); |
|
|
|
// ro2.translate(glm::vec3(0.0f, -0.01f, 0.01f));
|
|
|
|
// ro2.translate(glm::vec3(0.0f, -0.01f, 0.01f));
|
|
|
|
ro2.translate(glm::vec3(0.0f, 0.0f, -0.001f)); |
|
|
|
// ro2.translate(glm::vec3(0.0f, 0.0f, -0.001f));
|
|
|
|
ro2.rotate(glm::vec3(1.01f, 1.0f, 1.0f)); |
|
|
|
ro2.rotate(glm::vec3(1.01f, 1.0f, 1.0f)); |
|
|
|
|
|
|
|
|
|
|
|
// Render new frame
|
|
|
|
// Render new frame
|
|
|
|
scene.render(); |
|
|
|
scene.render(); |
|
|
|
|
|
|
|
|
|
|
|
// glfw
|
|
|
|
// glfw
|
|
|
|
glfwSwapBuffers(win.win); |
|
|
|
glfwSwapBuffers(win.getWindow()); |
|
|
|
glfwPollEvents(); |
|
|
|
glfwPollEvents(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|