why GLBasic crasch with this code ?
SETCURRENTDIR("Media") // seperate media and binaries?
global sp1GFX = geSprite_LoadGFX("1.png")
FUNCTION geSprite_LoadGFX: Filename$
LOCAL gfxID = GENSPRITE() //geID_GetFreeGFX(gfxIsSprite%)
LOADSPRITE Filename$, gfxID
RETURN gfxID
ENDFUNCTION
if the var sp1GFX is LOCAL no crash!!! if it's Global it CRASH!!! why? :noggin:
thanks!
because initialisation on deklaration wont work on globals.
GLOBAL var
var = muh();
Quote from: trucidare on 2010-Apr-25
because initialisation on deklaration wont work on globals.
GLOBAL var
var = muh();
doh!
Thanks !