end
# Take down, bring back default values
- glBindFramebuffer(gl_FRAMEBUFFER, shadow_context.screen_framebuffer)
+ bind_screen_framebuffer shadow_context.screen_framebuffer
glColorMask(true, true, true, true)
end
if dynamic_resolution_ratio == 1.0 then
# Draw directly to the screen framebuffer
- glBindFramebuffer(gl_FRAMEBUFFER, screen_framebuffer)
+ bind_screen_framebuffer screen_framebuffer
glViewport(0, 0, display.width, display.height)
glClear gl_COLOR_BUFFER_BIT | gl_DEPTH_BUFFER_BIT
var ratio = dynamic_resolution_ratio
ratio = ratio.clamp(min_dynamic_resolution_ratio, max_dynamic_resolution_ratio)
- glBindFramebuffer(gl_FRAMEBUFFER, screen_framebuffer)
+ bind_screen_framebuffer screen_framebuffer
glBindBuffer(gl_ARRAY_BUFFER, dynamic_context.buffer_array)
glViewport(0, 0, display.width, display.height)
glClear gl_COLOR_BUFFER_BIT | gl_DEPTH_BUFFER_BIT
# The framework handles resizing the viewport automatically.
fun on_resize(display: GamnitDisplay) do end
end
+
+# Portable indirection to `glBindFramebuffer(gl_FRAMEBUFFER, fbo)`
+#
+# This is implemented differently on iOS.
+fun bind_screen_framebuffer(fbo: Int) do glBindFramebuffer(gl_FRAMEBUFFER, fbo)