Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
+ frame_core_world_sprites display
+
# Toggle writing to the depth buffer for particles effects
glDepthMask false
for system in particle_systems do system.draw
glDepthMask true
# Toggle writing to the depth buffer for particles effects
glDepthMask false
for system in particle_systems do system.draw
glDepthMask true
- frame_core_flat display
+ frame_core_ui_sprites display
end
# Draw the whole screen, all `glDraw...` calls should be executed here
end
# Draw the whole screen, all `glDraw...` calls should be executed here
- protected fun frame_core_draw(display: GamnitDisplay) do frame_core_flat display
+ protected fun frame_core_draw(display: GamnitDisplay)
+ do
+ frame_core_world_sprites display
+ frame_core_ui_sprites display
+ end
- # Draw sprites in `sprites` and `ui_sprites`
- protected fun frame_core_flat(display: GamnitDisplay)
+ # Draw world sprites from `sprites`
+ protected fun frame_core_world_sprites(display: GamnitDisplay)
# World sprites
simple_2d_program.mvp.uniform world_camera.mvp_matrix
for sprite in sprites do sprite.draw
# World sprites
simple_2d_program.mvp.uniform world_camera.mvp_matrix
for sprite in sprites do sprite.draw
+ end
+
+ # Draw UI sprites from `ui_sprites`
+ protected fun frame_core_ui_sprites(display: GamnitDisplay)
+ do
+ simple_2d_program.use
+
+ # Set constant configs
+ simple_2d_program.coord.array_enabled = true
+ simple_2d_program.tex_coord.array_enabled = true
+ simple_2d_program.color.array_enabled = false
# Reset only the depth buffer
glClear gl_DEPTH_BUFFER_BIT
# Reset only the depth buffer
glClear gl_DEPTH_BUFFER_BIT
var display = display
assert display != null
glClear gl_COLOR_BUFFER_BIT
var display = display
assert display != null
glClear gl_COLOR_BUFFER_BIT
- frame_core_flat display
+ frame_core_ui_sprites display
display.flip
ui_sprites.remove splash
display.flip
ui_sprites.remove splash