mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 03:39:57 +01:00
Fixed blit of framebuffer
This commit is contained in:
@@ -227,13 +227,17 @@ void FrameBuffer::readPixels(uint8_t *target_data)
|
|||||||
|
|
||||||
bool FrameBuffer::blit(FrameBuffer *destination)
|
bool FrameBuffer::blit(FrameBuffer *destination)
|
||||||
{
|
{
|
||||||
if (!framebufferid_ || !destination)
|
if (!framebufferid_ || !destination || (use_alpha_ != destination->use_alpha_) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!destination->framebufferid_)
|
if (!destination->framebufferid_)
|
||||||
destination->init();
|
destination->init();
|
||||||
|
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferid_);
|
if (use_multi_sampling_)
|
||||||
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, intermediate_framebufferid_);
|
||||||
|
else
|
||||||
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferid_);
|
||||||
|
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, destination->framebufferid_);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, destination->framebufferid_);
|
||||||
// blit to the frame buffer object
|
// blit to the frame buffer object
|
||||||
glBlitFramebuffer(0, 0, attrib_.viewport.x, attrib_.viewport.y,
|
glBlitFramebuffer(0, 0, attrib_.viewport.x, attrib_.viewport.y,
|
||||||
|
|||||||
Reference in New Issue
Block a user