move the ui/shaders reload into the ui thread, add rtt region copy, add box/rect conversion
This commit is contained in:
22
src/rtt.cpp
22
src/rtt.cpp
@@ -103,7 +103,27 @@ void RTT::copy(const RTT & source)
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fboID);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, source.fboID);
|
||||
glBlitFramebuffer(0, 0, source.w, source.h, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_LINEAR);
|
||||
glBlitFramebuffer(0, 0, source.w, source.h, 0, 0, w, h,
|
||||
GL_COLOR_BUFFER_BIT, GL_LINEAR);
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, oldDFboID);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, oldRFboID);
|
||||
});
|
||||
}
|
||||
|
||||
void RTT::copy(const RTT& source, const glm::vec4& rect)
|
||||
{
|
||||
App::I->render_task([&]
|
||||
{
|
||||
auto r = rect_intersection(rect, { 0, 0, w, h });
|
||||
|
||||
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldDFboID);
|
||||
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &oldRFboID);
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fboID);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, source.fboID);
|
||||
glBlitFramebuffer(r.x, r.y, r.z, r.w, r.x, r.y, r.z, r.w,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, oldDFboID);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, oldRFboID);
|
||||
|
||||
Reference in New Issue
Block a user