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:strings"
import "core:math/rand" import "core:math/rand"
@@ -137,18 +137,17 @@ game_render :: proc(game: ^Game) {
rl.ClearBackground(rl.BLACK) rl.ClearBackground(rl.BLACK)
rl.BeginTextureMode(game.viewport) rl.BeginTextureMode(game.viewport)
rl.DrawTexture(game.bg_texture, 0, 0, rl.WHITE) rl.DrawTexture(game.bg_texture, 0, 0, rl.WHITE)
// World/Scene objects rendered through 2D camera space // World/Scene objects rendered through 2D camera space
rl.BeginMode2D(game.camera) rl.BeginMode2D(game.camera)
// Render all active items on the stack from bottom to top
// @note: fine for now but probably not a good idea... for &scene in game.scene_stack {
// Render all scenes in the stack from bottom to top scene_render(&scene)
for i in 0 ..< len(game.scene_stack) {
scene_render(&game.scene_stack[i])
} }
rl.EndMode2D() rl.EndMode2D()
rl.EndTextureMode() rl.EndTextureMode()
render_game_to_window(game) render_game_to_window(game)