remove direct use of rtt and dirty area from the layer
This commit is contained in:
15
src/rtt.cpp
15
src/rtt.cpp
@@ -35,8 +35,9 @@ RTT::~RTT()
|
||||
LOG("RTT not destroyed");
|
||||
}
|
||||
|
||||
void RTT::resize(int width, int height)
|
||||
bool RTT::resize(int width, int height)
|
||||
{
|
||||
bool ret = false;
|
||||
RTT new_rtt;
|
||||
|
||||
App::I->render_task([&]
|
||||
@@ -44,7 +45,12 @@ void RTT::resize(int width, int height)
|
||||
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldDFboID);
|
||||
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &oldRFboID);
|
||||
|
||||
new_rtt.create(width, height, -1, int_fmt, rboID != 0);
|
||||
ret = new_rtt.create(width, height, -1, int_fmt, rboID != 0);
|
||||
if (!ret)
|
||||
{
|
||||
LOG("failed to resize rtt from %dx%d to %dx%d", w, h, width, height);
|
||||
return;
|
||||
}
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, new_rtt.fboID);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, fboID);
|
||||
@@ -55,6 +61,9 @@ void RTT::resize(int width, int height)
|
||||
|
||||
destroy();
|
||||
});
|
||||
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
oldRFboID = 0;
|
||||
oldDFboID = 0;
|
||||
@@ -64,6 +73,8 @@ void RTT::resize(int width, int height)
|
||||
int_fmt = new_rtt.int_fmt;
|
||||
w = new_rtt.w;
|
||||
h = new_rtt.h;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void RTT::destroy()
|
||||
|
||||
Reference in New Issue
Block a user