Page 1 of 1
Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 2:36 pm
by nco2k
when writing a userlib, is there a trick how to check if InitSprite() / InitSprite3D() has been already called?
c ya,
nco2k
Re: Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 3:42 pm
by idle
I think you can get away with using ScreenID() but only when the debugger off
Re: Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 3:59 pm
by nco2k
ScreenID() works only if a screen is open, which is not exactly what i was looking for.
c ya,
nco2k
Re: Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 4:57 pm
by ts-soft
I think adding sprite.lib to the depedencies of the desc-file of the userlib should work,
or Import "Sprite.lib" : EndImport", but not tested,
but i would not call InitSpite in the userlib!
Re: Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 5:24 pm
by nco2k
ts-soft wrote:but i would not call InitSpite in the userlib!
why not? as long as its not inside the AttachProcess() it should be perfectly fine.
c ya,
nco2k
Re: Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 6:01 pm
by netmaestro
why not? as long as its not inside the AttachProcess() it should be perfectly fine.

A userlib isn't a dll..
Re: Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 6:04 pm
by C64
nco2k wrote:when writing a userlib, is there a trick how to check if InitSprite() / InitSprite3D() has been already called?
Why not save yourself the hassle and just say in your manual that those commands must be called before using the commands in your lib? Why reinvent the wheel?
Re: Check if InitSprite() has been already called
Posted: Sat Feb 19, 2011 6:19 pm
by nco2k
@netmaestro
i mean the tailbite *_Init()
@C64
because i dont want them to call it at all?! and since no one reads TFM, i just want to be on the safe side.
c ya,
nco2k