Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / screen invalid ()

Author
Message
Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 27th Mar 2008 19:13
hey there ... I was told that in order to prevent the all-so-common bug, where the game would crash after an Alt-Tab, I had to check for SCREEN INVALID () because I can't afford to load everything back up .... anyway, here's what I do:
in my main DO - LOOP I have this at the very beginning of the loop: if screen invalid()=1 then end .... so I guess it should exit the game after returning from an Alt-Tab but instead, it exits the game as soon as it enters the loop any idea what to do ??? thanks

Could you help me treat my injured Dino-Fly ?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2008 19:28
Yes, the display isn't fully set up until you've called SYNC a few times. Just put 2 SYNC commands immediately after your SYNC ON (or at the top of your program otherwise) and that will do the job for you.

Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 27th Mar 2008 21:55
hmm when u said to call SYNC 2 times, is 2 a precise minimal value or you just think it will work ?? I'm asking cause I want to figure out when exactly does the engine recognize the program as fully set up thanks

Could you help me treat my injured Dino-Fly ?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2008 23:12
That's a new one - it used to work, but doesn't any more. Thanks for the heads-up.

You don't actually need any SYNC to check, you just need to call the SCREEN INVALID function once before checking it for real.


Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 27th Mar 2008 23:27
ahhh cool it's nice to see that after you're fair good with a language, you come and stumble upon small things such as these, which have no logic in the end ... nobody could have thought of it ... it's just a little, yet big thing u have to discover every language I've used in the past had this problems ... thanks a lot guys !!!

Could you help me treat my injured Dino-Fly ?

Login to post a reply

Server time is: 2024-11-25 05:24:23
Your offset time is: 2024-11-25 05:24:23