1
0
Fork 0

Compare commits

...

3 commits

4 changed files with 16 additions and 0 deletions

View file

@ -6,6 +6,9 @@ import (
"tetris/engine/graphics/font"
)
//go:embed icon.png
var Icon []byte
//go:embed sprites.png
var Sprite []byte

BIN
assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

7
engine/graphics/image.go Normal file
View file

@ -0,0 +1,7 @@
package graphics
import rl "github.com/gen2brain/raylib-go/raylib"
func LoadImageFromMemory(typ string, data []byte) *rl.Image {
return rl.LoadImageFromMemory(typ, data, int32(len(data)))
}

View file

@ -22,6 +22,12 @@ func main() {
})
defer render.Exit()
// Set window icon
if icon := graphics.LoadImageFromMemory(".png", assets.Icon); icon != nil {
rl.SetWindowIcon(*icon)
rl.UnloadImage(icon)
}
audio.Init()
defer audio.Exit()