27 lines
815 B
C++
27 lines
815 B
C++
#include "funcs.h"
|
|
|
|
void framebuffer_size_callback(GLFWwindow* window, int width, int height) {
|
|
glViewport(0, 0, width, height);
|
|
}
|
|
|
|
void processInput(GLFWwindow* window) {
|
|
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) {
|
|
glfwSetWindowShouldClose(window, true);
|
|
}
|
|
if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS) {
|
|
cam->yaw(0.05f);
|
|
}
|
|
if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS) {
|
|
cam->yaw(-0.05f);
|
|
}
|
|
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS) {
|
|
cam->pitch(0.05f);
|
|
}
|
|
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) {
|
|
cam->pitch(-0.05f);
|
|
}
|
|
if (glfwGetKey(window, GLFW_KEY_Q) == GLFW_PRESS) {
|
|
cam->setTarget(glm::vec3(0.0f, 0.0f, 0.0f));
|
|
cam->setWorldUp(glm::vec3(0.0f, 1.0f, 0.0f));
|
|
}
|
|
} |