when writing a userlib, is there a trick how to check if InitSprite() / InitSprite3D() has been already called?
c ya,
nco2k
Check if InitSprite() has been already called
Check if InitSprite() has been already called
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: Check if InitSprite() has been already called
I think you can get away with using ScreenID() but only when the debugger off
Windows 11, Manjaro, Raspberry Pi OS


Re: Check if InitSprite() has been already called
ScreenID() works only if a screen is open, which is not exactly what i was looking for.
c ya,
nco2k
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: Check if InitSprite() has been already called
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!
or Import "Sprite.lib" : EndImport", but not tested,
but i would not call InitSpite in the userlib!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: Check if InitSprite() has been already called
why not? as long as its not inside the AttachProcess() it should be perfectly fine.ts-soft wrote:but i would not call InitSpite in the userlib!
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Check if InitSprite() has been already called
why not? as long as its not inside the AttachProcess() it should be perfectly fine.

BERESHEIT
Re: Check if InitSprite() 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?nco2k wrote:when writing a userlib, is there a trick how to check if InitSprite() / InitSprite3D() has been already called?
Re: Check if InitSprite() has been already called
@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
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
If OSVersion() = #PB_OS_Windows_ME : End : EndIf