# Should this program use the texture `map_diffuse`?
var use_map_diffuse = uniforms["use_map_diffuse"].as(UniformBool) is lazy
- # Diffuser texture unit
+ # Diffuse texture unit
var map_diffuse = uniforms["map_diffuse"].as(UniformSampler2D) is lazy
# Should this program use the texture `map_specular`?
end
end
-# Program drawing the dynamic screen to the real screen
+# Handles to reused GL buffers and texture
private class DynamicContext
# Real screen framebuffer
# Buffer name for vertex data
var buffer_array: Int = -1
- var float_per_vertex: Int is lazy do return 4 + 4 + 3
-
# Prepare all attributes once per resolution change
fun prepare_once(display: GamnitDisplay, max_dynamic_resolution_ratio: Float)
do
# Depth
glBindRenderbuffer(gl_RENDERBUFFER, depthbuffer)
assert glIsRenderbuffer(depthbuffer)
- glRenderbufferStorage(gl_RENDERBUFFER, gl_DEPTH_COMPNENT16, width, height)
+ glRenderbufferStorage(gl_RENDERBUFFER, gl_DEPTH_COMPONENT16, width, height)
glFramebufferRenderbuffer(gl_FRAMEBUFFER, gl_DEPTH_ATTACHMENT, gl_RENDERBUFFER, depthbuffer)
var gl_error = glGetError
assert gl_error == gl_NO_ERROR else print_error gl_error
fun gl_RGB5_A1: GLRenderbufferFormat `{ return GL_RGB5_A1; `}
# 16 depth bits format
-fun gl_DEPTH_COMPNENT16: GLRenderbufferFormat `{ return GL_DEPTH_COMPONENT16; `}
+fun gl_DEPTH_COMPONENT16: GLRenderbufferFormat `{ return GL_DEPTH_COMPONENT16; `}
# 8 stencil bits format
fun gl_STENCIL_INDEX8: GLRenderbufferFormat `{ return GL_STENCIL_INDEX8; `}
fun gl_ALPHA: GLPixelFormat `{ return GL_ALPHA; `}
fun gl_RGB: GLPixelFormat `{ return GL_RGB; `}
fun gl_RGBA: GLPixelFormat `{ return GL_RGBA; `}
+fun gl_DEPTH_COMPONENT: GLPixelFormat `{ return GL_DEPTH_COMPONENT; `}
# Set of buffers as a bitwise OR mask
extern class GLBuffer `{ GLbitfield `}