Scene rendering is better now with parent setup.

This commit is contained in:
2026-10-08 07:44:31 +02:00
parent 200e05f2dc
commit 5395225cc2
+6 -7
View File
@@ -1,4 +1,4 @@
package game
package game
import "core:strings"
import "core:math/rand"
@@ -137,18 +137,17 @@ game_render :: proc(game: ^Game) {
rl.ClearBackground(rl.BLACK)
rl.BeginTextureMode(game.viewport)
rl.DrawTexture(game.bg_texture, 0, 0, rl.WHITE)
// World/Scene objects rendered through 2D camera space
rl.BeginMode2D(game.camera)
// @note: fine for now but probably not a good idea...
// Render all scenes in the stack from bottom to top
for i in 0 ..< len(game.scene_stack) {
scene_render(&game.scene_stack[i])
// Render all active items on the stack from bottom to top
for &scene in game.scene_stack {
scene_render(&scene)
}
rl.EndMode2D()
rl.EndTextureMode()
render_game_to_window(game)