|
|
|
@ -127,13 +127,13 @@ int main() { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
glViewport(0, 0, win.width(), win.height()); |
|
|
|
|
glfwSetFramebufferSizeCallback(win.win, framebuffer_size_callback); // Framebuffer
|
|
|
|
|
glViewport(0, 0, win.getWidth(), win.getHeight()); |
|
|
|
|
glfwSetFramebufferSizeCallback(win.getWindow(), framebuffer_size_callback); // Framebuffer
|
|
|
|
|
|
|
|
|
|
glEnable(GL_DEPTH_TEST); |
|
|
|
|
|
|
|
|
|
// 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}; |
|
|
|
|
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)); |
|
|
|
|
scene.setCamera(&player); |
|
|
|
|
|
|
|
|
|
while (!glfwWindowShouldClose(win.win)) { |
|
|
|
|
while (!glfwWindowShouldClose(win.getWindow())) { |
|
|
|
|
// Handle input
|
|
|
|
|
player.processInput(scene.deltaTime); |
|
|
|
|
processInput(win.win); |
|
|
|
|
processInput(win.getWindow()); |
|
|
|
|
|
|
|
|
|
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.0f, -0.001f)); |
|
|
|
|
// ro2.translate(glm::vec3(0.0f, 0.0f, -0.001f));
|
|
|
|
|
ro2.rotate(glm::vec3(1.01f, 1.0f, 1.0f)); |
|
|
|
|
|
|
|
|
|
// Render new frame
|
|
|
|
|
scene.render(); |
|
|
|
|
|
|
|
|
|
// glfw
|
|
|
|
|
glfwSwapBuffers(win.win); |
|
|
|
|
glfwSwapBuffers(win.getWindow()); |
|
|
|
|
glfwPollEvents(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|