diff --git a/src/game.odin b/src/game.odin index 9b9e135..790392a 100644 --- a/src/game.odin +++ b/src/game.odin @@ -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)