Scene rendering is better now with parent setup.
This commit is contained in:
+6
-7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user