Compare commits
2
Commits
8edae62e10
...
de088f69e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de088f69e6 | ||
|
|
294ffb70cc |
+1
-1
@@ -39,9 +39,9 @@ run :: proc(app: ^App) {
|
||||
|
||||
rl.SetTargetFPS(60)
|
||||
for !rl.WindowShouldClose() {
|
||||
rl.ClearBackground(window.background)
|
||||
for i in app.systems[UPDATE] {i()}
|
||||
rl.BeginDrawing()
|
||||
rl.ClearBackground(window.background)
|
||||
for i in app.systems[DRAW] {i()}
|
||||
rl.EndDrawing()
|
||||
}
|
||||
|
||||
+1
-6
@@ -44,7 +44,7 @@ single :: proc(storage: ^Storage($T)) -> (Entity, ^T) {
|
||||
for i, &v in slice(storage) {
|
||||
return i, &v
|
||||
}
|
||||
return Entity{}, new(T)
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// get component of type from entity
|
||||
@@ -54,8 +54,3 @@ get_component :: proc(entity: Entity, storage: ^Storage($T)) -> ^T {
|
||||
}
|
||||
return new(T)
|
||||
}
|
||||
|
||||
// alias for direct mutation access
|
||||
get_component_with_ref :: proc(entity: Entity, storage: ^Storage($T)) -> ^T {
|
||||
return get_component(entity, storage)
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ DefaultPlugin :: proc(app: ^App) {
|
||||
add_component(
|
||||
display,
|
||||
&Window,
|
||||
WindowComponent{width = 800, height = 600, title = "shoal window"},
|
||||
WindowComponent{width = 800, height = 600, title = "shoal window", background = rl.BLACK},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user