changes for nix
This commit is contained in:
13
main.cpp
13
main.cpp
@@ -1,8 +1,8 @@
|
||||
#include "glad/glad.h"
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
#include "glm/gtc/type_ptr.hpp"
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <glm/ext/matrix_transform.hpp>
|
||||
@@ -22,6 +22,7 @@ float deltaTime = 0.0f; // Time between current frame and last frame
|
||||
float lastFrame = 0.0f; // Time of last frame
|
||||
float lastX = 600 / 2.0f;
|
||||
float lastY = 800 / 2.0f;
|
||||
|
||||
Camera camera(glm::vec3(1.0f, 1.0f, 1.0f));
|
||||
bool firstMouse = true;
|
||||
|
||||
@@ -317,7 +318,7 @@ int main() {
|
||||
glfwWindowHintString(GLFW_WAYLAND_APP_ID, "opengl");
|
||||
|
||||
GLFWwindow *window =
|
||||
glfwCreateWindow(1000, 600, "testing open gl", NULL, NULL);
|
||||
glfwCreateWindow(800, 600, "testing open gl", NULL, NULL);
|
||||
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||
glfwSetCursorPosCallback(window, mouse_callback);
|
||||
@@ -547,6 +548,10 @@ int main() {
|
||||
glm::vec3(camera.Position.x, 5.0f, camera.Position.z);
|
||||
float gravity = -9.81f;
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
int fbw, fbh;
|
||||
glfwGetFramebufferSize(window, &fbw, &fbh);
|
||||
glViewport(0, 0, fbw, fbh);
|
||||
|
||||
float currentFrame = glfwGetTime();
|
||||
float ground = 1.0f;
|
||||
deltaTime = currentFrame - lastFrame;
|
||||
|
||||
Reference in New Issue
Block a user