mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 07:49:19 +02:00
GLES support
This commit is contained in:
@@ -59,11 +59,15 @@ void gl::framebuffer::blit_to(framebuffer &other, int w, int h, GLbitfield mask,
|
||||
{
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, *this);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, other);
|
||||
if (mask & GL_COLOR_BUFFER_BIT)
|
||||
{
|
||||
glReadBuffer(attachment);
|
||||
glDrawBuffer(attachment);
|
||||
}
|
||||
|
||||
int attachment_n = attachment - GL_COLOR_ATTACHMENT0;
|
||||
|
||||
GLenum outputs[8] = { GL_NONE };
|
||||
outputs[attachment_n] = attachment;
|
||||
|
||||
glReadBuffer(attachment);
|
||||
glDrawBuffers(attachment_n + 1, outputs);
|
||||
|
||||
glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, mask, GL_NEAREST);
|
||||
unbind();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user