Added scene related things

This commit is contained in:
2022-04-23 22:46:06 +03:00
parent 3c721273c0
commit 50d032418e
27 changed files with 1177 additions and 16 deletions
+8 -7
View File
@@ -1,5 +1,6 @@
#include "fbo.h"
#include "demo_data.h"
#include <memory>
BEGIN_NAMESPACE
@@ -48,22 +49,22 @@ GLuint fbo::get_depth_buffer_id() const {
}
void fbo::use() {
old_width = SCREEN_WIDTH;
old_height = SCREEN_HEIGHT;
old_width = demo_data::screen_width;
old_height = demo_data::screen_height;
SCREEN_WIDTH = width;
SCREEN_HEIGHT = height;
demo_data::screen_height = width;
demo_data::screen_height = height;
glBindFramebuffer(GL_FRAMEBUFFER, frame_buffer_id);
glViewport(0, 0, width, height);
}
void fbo::unuse() {
void fbo::unuse() const {
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, old_width, old_height);
SCREEN_WIDTH = old_width;
SCREEN_HEIGHT = old_height;
demo_data::screen_width = old_width;
demo_data::screen_height = old_height;
}
std::shared_ptr<texture> fbo::get_texture() {