Fixed a GL bug that caused screenshots to grab from the wrong framebuffer.
@@ -3895,7 +3895,8 @@ void skg_tex_copy_to(const skg_tex_t *tex, skg_tex_t *destination) {
skg_tex_set_contents_arr(destination, nullptr, tex->array_count, tex->width, tex->height, tex->multisample);
}
- glBindTexture (tex->_target, destination->_texture);
+ glBindFramebuffer (GL_FRAMEBUFFER, tex->_framebuffer);
+ glBindTexture (destination->_target, destination->_texture);
glCopyTexSubImage2D(destination->_target, 0, 0,0,0,0,tex->width,tex->height);
}
