16
0
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:
milek7
2018-10-16 20:32:45 +02:00
parent f8857158ce
commit d16d96f2b2
77 changed files with 5601 additions and 26893 deletions

View File

@@ -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();
}