diff --git a/Outputs/OpenGL/Primitives/TextureTarget.cpp b/Outputs/OpenGL/Primitives/TextureTarget.cpp index 02aac2ed5..175ebff09 100644 --- a/Outputs/OpenGL/Primitives/TextureTarget.cpp +++ b/Outputs/OpenGL/Primitives/TextureTarget.cpp @@ -70,6 +70,9 @@ TextureTarget::TextureTarget(GLsizei width, GLsizei height, GLenum texture_unit, break; } } + + // Clear the framebuffer. + test_gl(glClear, GL_COLOR_BUFFER_BIT); } TextureTarget::~TextureTarget() { diff --git a/Outputs/OpenGL/Primitives/TextureTarget.hpp b/Outputs/OpenGL/Primitives/TextureTarget.hpp index 59fd42d51..22321ed08 100644 --- a/Outputs/OpenGL/Primitives/TextureTarget.hpp +++ b/Outputs/OpenGL/Primitives/TextureTarget.hpp @@ -77,9 +77,9 @@ class TextureTarget { private: GLuint framebuffer_ = 0, texture_ = 0, renderbuffer_ = 0; - GLsizei width_ = 0, height_ = 0; + const GLsizei width_ = 0, height_ = 0; GLsizei expanded_width_ = 0, expanded_height_ = 0; - GLenum texture_unit_ = 0; + const GLenum texture_unit_ = 0; mutable std::unique_ptr pixel_shader_; mutable GLuint drawing_vertex_array_ = 0, drawing_array_buffer_ = 0;