Fix some high severity bugs
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ private:
|
||||
float speed = 2.0f;
|
||||
|
||||
float fov;
|
||||
float exposure = 1.0f;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void Controller::run()
|
||||
// This is the game loop
|
||||
while (!glfwWindowShouldClose(gameWindow->getGLFWwindow())) {
|
||||
// --- Timing ---
|
||||
//limit_framerate();
|
||||
limit_framerate();
|
||||
|
||||
// --- Update game ---
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user