Compare commits
3 commits
634fd7ce40
...
57e57f3037
| Author | SHA1 | Date | |
|---|---|---|---|
| 57e57f3037 | |||
| 93736e060e | |||
| 5b54466018 |
4 changed files with 16 additions and 0 deletions
|
|
@ -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
BIN
assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 153 B |
7
engine/graphics/image.go
Normal file
7
engine/graphics/image.go
Normal 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)))
|
||||
}
|
||||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue