diff --git a/source/engine/graphics/front/engine/Engine.cpp b/source/engine/graphics/front/engine/Engine.cpp index 6c78b0c62d46c016d92be8c5f23880f4db0432a4..f4f093e303255511fc000dc21838df1ae4c4b8a9 100644 --- a/source/engine/graphics/front/engine/Engine.cpp +++ b/source/engine/graphics/front/engine/Engine.cpp @@ -27,7 +27,6 @@ namespace megu { // Merge Textures FrameBuffer::BindDefaultFrameBuffer(); - this->_renderer.clear(); this->_renderer.render(this->_window, this->_group, textures); this->_window.swapBuffers(); } diff --git a/source/engine/graphics/front/engine/Layer.cpp b/source/engine/graphics/front/engine/Layer.cpp index 762f10a04b7d72f2dfa617100e92cba80cad399a..63a0e4d474c7ee148101d5b5e808f7c8cb65fea7 100644 --- a/source/engine/graphics/front/engine/Layer.cpp +++ b/source/engine/graphics/front/engine/Layer.cpp @@ -12,14 +12,10 @@ namespace megu { } const Texture & Layer::draw(const Window & window, const TextureArray & textures) const { - if(this->_frameBuffer.usable()) { - this->_renderer.setClearColor(0.f, 0.f, 0.f, 0.f); - this->_renderer.clear(); - this->_frameBuffer.bind(); + this->_frameBuffer.bind(); - for(auto &[priority, group] : this->_objects) { - this->_renderer.render(window, *group, textures); - } + for(auto &[priority, group] : this->_objects) { + this->_renderer.render(window, *group, textures); } return this->_frameBuffer.texture(); diff --git a/source/engine/graphics/front/group/FrameBufferGroup.cpp b/source/engine/graphics/front/group/FrameBufferGroup.cpp index 730ab9986cee9bb761f7c2d99fbaab23fb1921d8..cae296d2121c26390f1527b9634236139872be71 100644 --- a/source/engine/graphics/front/group/FrameBufferGroup.cpp +++ b/source/engine/graphics/front/group/FrameBufferGroup.cpp @@ -21,17 +21,15 @@ namespace megu { } void FrameBufferGroup::draw(const Window & window, const Camera & camera, const TextureArray & textures) const { - if(window.isOpen()) { - this->_program.use(); - this->_vao.bind(); - - for(GLuint i = 0; i < static_cast<GLuint>(textures.size()); ++i) { - textures[i].get().bind(static_cast<GLuint>(i)); - } - - this->_program.setUniform("uSampler", std::vector<GLint>{0, 1, 2, 3, 4, 5, 6 , 7, 8, 9, 10}); - this->_program.setUniform("uTexturesCount", static_cast<GLuint>(textures.size())); - glDrawArrays(Plane::Primitive(), 0, static_cast<GLsizei>(Plane::Vertices().size())); - } + this->_program.use(); + this->_vao.bind(); + + for(GLuint i = 0; i < static_cast<GLuint>(textures.size()); ++i) { + textures[i].get().bind(static_cast<GLuint>(i)); + } + + this->_program.setUniform("uSampler", std::vector<GLint>{0, 1, 2, 3, 4, 5, 6 , 7, 8, 9, 10}); + this->_program.setUniform("uTexturesCount", static_cast<GLuint>(textures.size())); + glDrawArrays(Plane::Primitive(), 0, static_cast<GLsizei>(Plane::Vertices().size())); } } \ No newline at end of file diff --git a/source/engine/graphics/front/group/ImageGroup.cpp b/source/engine/graphics/front/group/ImageGroup.cpp index c1c8cf664ffad2a7b0a9e0c5ab6ee96a5c7a814d..f5ce936e8629272da56124d1b1c7b2bd53d39121 100644 --- a/source/engine/graphics/front/group/ImageGroup.cpp +++ b/source/engine/graphics/front/group/ImageGroup.cpp @@ -70,8 +70,6 @@ namespace megu { } } - //std::cout << "---------------" << std::endl; - if(!textures.empty()) { this->_program.setUniform("uProj", camera.projection()); this->_program.setUniform("uView", camera.view());