May 26, 2021 09:25 am GMT
Original Link: https://dev.to/baenencalin/why-do-i-keep-getting-this-weird-error-when-trying-to-draw-an-image-2bmg
Why do I keep getting this weird error when trying to load an image?
So I'm trying to make a game in GoLang using Raylib Go (Go bindings of a C library with the same name).
I'm using a temporary variable to test if I can load a texture (I'm only gonna show the one line, as that's the only thing that makes the program crash):
var _ rl.Texture2D = rl.LoadTexture("./rsrc/textures/logo.png");
Yes, the path "./rsrc/textures/logo.png
" exists (relative to the executable's default directory).
After putting that in, I ran two commands in Command Prompt (Windows 10)
C:\Users\Administrator\Desktop\Projects\Go\games\RuntDeale>go build ./rsrc/codeC:\Users\Administrator\Desktop\Projects\Go\games\RuntDeale>code
After running that last command, no window appeared, and the program had seemed to have ended.
But I got this lovely jumble of text printed to me:
INFO: FILEIO: [./rsrc/textures/logo.png] File loaded successfullyINFO: IMAGE: [./rsrc/textures/logo.png] Data loaded successfully (76x17)Exception 0xc0000005 0x8 0x0 0x0PC=0x0signal arrived during external code executiongithub.com/gen2brain/raylib-go/raylib._Cfunc_LoadTexture(0x14d740b1bb0, 0x0, 0x0, 0xc000000000) _cgo_gotypes.go:4223 +0x54github.com/gen2brain/raylib-go/raylib.LoadTexture(0x972c59, 0x18, 0x0, 0x0, 0x14d00000000) C:/Users/Administrator/go/pkg/mod/github.com/gen2brain/[email protected]/raylib/textures.go:69 +0x95main.main() C:/Users/Administrator/Desktop/Projects/Go/games/RuntDeale/rsrc/code/main.go:28 +0xa5rax 0x700000001rbx 0x2a527ffaf0rcx 0xde1rdi 0x11rsi 0x4crbp 0x7rsp 0x2a527ff978r8 0x11r9 0x7r10 0x0r11 0x246r12 0x1r13 0x978368r14 0x37r15 0xffffffffffffffffrip 0x0rflags 0x10246cs 0x33fs 0x53gs 0x2b
It says the file loaded successfully, but then it has some kind of error, and doesn't really make any sense.
What does this mean, and how can I fix it?
Thanks!
Cheers!
Original Link: https://dev.to/baenencalin/why-do-i-keep-getting-this-weird-error-when-trying-to-draw-an-image-2bmg
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To