Closed hfabre closed 3 years ago
@hfabre
package main
import (
rl "github.com/chunqian/go-raylib/raylib"
"runtime"
)
func init() {
runtime.LockOSThread()
}
func main() {
screenWidth := int32(800)
screenHeight := int32(450)
rl.InitWindow(screenWidth, screenHeight, "raylib test")
tileset := rl.LoadImage("./tileset.png")
_ = rl.LoadTextureFromImage(tileset)
}
You need call rl.InitWindow()
go-raylib used keep consistent with raylib c
Oh sorry, I encountered this segmentation fault in a bigger project and I tried to reduce the code to make it easier to debug but it looks like there is no bug with this example. I'm going to take more time to debug my project to see if it's a bug or if I made a mistake
Just gave a quick look at my project, and it looks like I made the same mistake, calling LoadTextureFromImage
before initializing the window, sorry for the inconvenience
Hi, using
LoadTextureFromImage
I got segmentation fault each time. Pretty short to reproduce:Results in:
Here is the image in case you need it: