Added scene related things
This commit is contained in:
+8
-7
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user