I was trying to implement a change-over between Windowed mode and Full screen mode, and was seeing some really weird things...
May be obvious in hindsight, but I should probably bring it up anyway and maybe safe someone else some hair-pulling moments.
I found that when I ended the current graphics mode and switched to a new graphics mode (in particular between windowed and full screen) that the sprites I had loaded were gone. I knew that that would be the case, I had a function to reload them.
However, what kind of threw me off is that this worked only intermittently:
Going from full screen to windowed mode would require the sprite loading routine to be called TWICE to have any effect, while the other way around (windowed to full screen) would only work if I called it ONCE.
Switching from full screen to windowed and only loading the sprites once would return in a white screen, and then switching back to full screen would require the sprites to be reloaded twice in a row before anything other than a white screen would be drawn...
Extremely confusing...
The fix turned out to be to explicitely de-reference all existing sprites FIRST (mysprite=NULL, flushmem) and then do the loading... I was under the impression that it should be able to simply load & overwrite the old info on the fly, and the confusing part was that this DID work, but only part of the time.
Is this a bug, or a 'feature'? Might be worth mentioning some of these situations in the manual somewhere...
May be obvious in hindsight, but I should probably bring it up anyway and maybe safe someone else some hair-pulling moments.
I found that when I ended the current graphics mode and switched to a new graphics mode (in particular between windowed and full screen) that the sprites I had loaded were gone. I knew that that would be the case, I had a function to reload them.
However, what kind of threw me off is that this worked only intermittently:
Going from full screen to windowed mode would require the sprite loading routine to be called TWICE to have any effect, while the other way around (windowed to full screen) would only work if I called it ONCE.
Switching from full screen to windowed and only loading the sprites once would return in a white screen, and then switching back to full screen would require the sprites to be reloaded twice in a row before anything other than a white screen would be drawn...
Extremely confusing...
The fix turned out to be to explicitely de-reference all existing sprites FIRST (mysprite=NULL, flushmem) and then do the loading... I was under the impression that it should be able to simply load & overwrite the old info on the fly, and the confusing part was that this DID work, but only part of the time.
Is this a bug, or a 'feature'? Might be worth mentioning some of these situations in the manual somewhere...