diff --git a/imgui.ini b/imgui.ini index 2c58623..6149aa5 100644 --- a/imgui.ini +++ b/imgui.ini @@ -9,7 +9,7 @@ Size=894,195 Collapsed=0 [Window][Debug Utils] -Pos=-18,7 -Size=871,365 +Pos=18,8 +Size=791,379 Collapsed=0 diff --git a/src/Camera.h b/src/Camera.h index c2d62ae..bdfb675 100644 --- a/src/Camera.h +++ b/src/Camera.h @@ -61,7 +61,6 @@ private: float speed = 2.0f; float fov; - float exposure = 1.0f; }; diff --git a/src/Controller.cpp b/src/Controller.cpp index 1d08716..f621915 100644 --- a/src/Controller.cpp +++ b/src/Controller.cpp @@ -115,7 +115,7 @@ void Controller::run() // This is the game loop while (!glfwWindowShouldClose(gameWindow->getGLFWwindow())) { // --- Timing --- - //limit_framerate(); + limit_framerate(); // --- Update game --- diff --git a/src/EventHandler.cpp b/src/EventHandler.cpp index 0170c7c..5e66ec1 100644 --- a/src/EventHandler.cpp +++ b/src/EventHandler.cpp @@ -10,8 +10,8 @@ bool EventHandler::firstMouseInput = 1; float EventHandler::mouseSensitivity = 0.5f; -EventHandler::EventHandler(GLFWwindow *window) : - window(window) +EventHandler::EventHandler(GLFWwindow *p_window) : + window(p_window) { glfwSetKeyCallback(window, key_callback); glfwSetCursorPosCallback(window, mouse_callback); diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index 406e9cc..a047445 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -8,7 +8,7 @@ Framebuffer::Framebuffer(uint32_t width, uint32_t height, ShaderProgram *shaderP { glGenFramebuffers(1, &FBO); - generateTextutes(width, height); + generateTextures(width, height); } Framebuffer::~Framebuffer() @@ -27,7 +27,7 @@ void Framebuffer::unbind() glBindFramebuffer(GL_FRAMEBUFFER, 0); } -void Framebuffer::render(GLuint customTextureId) +void Framebuffer::render() { // Disable wireframe mode GLint wireframe; @@ -36,11 +36,8 @@ void Framebuffer::render(GLuint customTextureId) shaderProgram->bind(); glActiveTexture(GL_TEXTURE0); - if(customTextureId) { - glBindTexture(GL_TEXTURE_2D, customTextureId); - } else { - glBindTexture(GL_TEXTURE_2D, getTextureId()); - } + glBindTexture(GL_TEXTURE_2D, getTextureId()); + GLint location = glGetUniformLocation(shaderProgram->getShaderProgramId(), "u_texture"); glUniform1i(location, 0); @@ -60,10 +57,10 @@ void Framebuffer::changeDimensions(uint32_t width, uint32_t height) // Delete old textures glDeleteTextures(2, textures); - generateTextutes(width, height); + generateTextures(width, height); } -void Framebuffer::generateTextutes(uint32_t width, uint32_t height) +void Framebuffer::generateTextures(uint32_t width, uint32_t height) { // Create new textures glGenTextures(2, textures); diff --git a/src/Framebuffer.h b/src/Framebuffer.h index 91c0f18..584bb04 100644 --- a/src/Framebuffer.h +++ b/src/Framebuffer.h @@ -13,7 +13,7 @@ public: void bind(); void unbind(); - void render(GLuint customTextureId = 0); + void render(); void changeDimensions(uint32_t width, uint32_t height); @@ -24,7 +24,7 @@ public: void setExposureCorrection(bool exposureCorrection); private: - void generateTextutes(uint32_t width, uint32_t height); + void generateTextures(uint32_t width, uint32_t height); GLuint FBO; GLuint textures[2]; diff --git a/src/Light.h b/src/Light.h index c07bb91..f056ac2 100644 --- a/src/Light.h +++ b/src/Light.h @@ -9,6 +9,8 @@ class Light { public: + virtual ~Light() {} + virtual void update() = 0; void setActive(bool active) @@ -38,7 +40,6 @@ public: protected: Light(ShaderProgram *shaderProgram) : shaderProgram(shaderProgram) {} - ~Light() {} ShaderProgram *shaderProgram; diff --git a/src/Widget.cpp b/src/Widget.cpp index 784746f..43ca054 100644 --- a/src/Widget.cpp +++ b/src/Widget.cpp @@ -1,8 +1,8 @@ #include "Widget.h" #include "VertexArray.h" -Widget::Widget(Texture *texture, float x, float y, float w, float h) : - x(x), y(y), w(w), h(h) +Widget::Widget(Texture *texture, float p_x, float p_y, float p_w, float p_h) : + x(p_x), y(p_y), w(p_w), h(p_h) { widgetTextures.push_back(texture);