feat: initialize and use audio subsystem.
This commit is contained in:
parent
1c31fd43ac
commit
173adadb84
1 changed files with 7 additions and 0 deletions
7
main.go
7
main.go
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
"tetris/assets"
|
"tetris/assets"
|
||||||
|
"tetris/engine/audio"
|
||||||
"tetris/engine/core"
|
"tetris/engine/core"
|
||||||
"tetris/engine/graphics"
|
"tetris/engine/graphics"
|
||||||
"tetris/engine/render"
|
"tetris/engine/render"
|
||||||
|
|
@ -118,6 +119,11 @@ func main() {
|
||||||
})
|
})
|
||||||
defer render.Exit()
|
defer render.Exit()
|
||||||
|
|
||||||
|
audio.Init()
|
||||||
|
defer audio.Exit()
|
||||||
|
|
||||||
|
audio.LoadLibrary(assets.LoadSound())
|
||||||
|
|
||||||
// Load texture
|
// Load texture
|
||||||
texture := graphics.LoadTextureFromMemory(".png", assets.Sprite)
|
texture := graphics.LoadTextureFromMemory(".png", assets.Sprite)
|
||||||
defer rl.UnloadTexture(texture)
|
defer rl.UnloadTexture(texture)
|
||||||
|
|
@ -129,6 +135,7 @@ func main() {
|
||||||
SpawnShape()
|
SpawnShape()
|
||||||
|
|
||||||
for !rl.WindowShouldClose() {
|
for !rl.WindowShouldClose() {
|
||||||
|
audio.Update()
|
||||||
Update(rl.GetFrameTime())
|
Update(rl.GetFrameTime())
|
||||||
Render()
|
Render()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue