Work on rendering to FBO

This commit is contained in:
Kovid Goyal
2017-11-23 17:56:20 +05:30
parent f85c050235
commit ffff343e3d
8 changed files with 101 additions and 30 deletions

View File

@@ -63,8 +63,12 @@ gl_init() {
}
void
update_surface_size(int w, int h) {
update_surface_size(int w, int h, GLuint offscreen_texture_id) {
glViewport(0, 0, w, h);
if (offscreen_texture_id) {
glBindTexture(GL_TEXTURE_2D, offscreen_texture_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
}
}
void
@@ -251,7 +255,7 @@ typedef struct {
ssize_t buffers[10];
} VAO;
static VAO vaos[2*MAX_CHILDREN + 10] = {{0}};
static VAO vaos[4*MAX_CHILDREN + 10] = {{0}};
static ssize_t
create_vao() {