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.

DarkBASIC Discussion / Query on system keys

Author
Message
Robert The Robot
19
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 31st May 2007 17:49
I'm having trouble with the "Alt+Tab" system key command.

When my program is running, it minimises the program, but when I restore it, the 3D objects leave a trail as they move across the screen. Is there a way to set it so that the screen refreshes properly?

(It may be a few days before I can read any replies to this post, so please bear with me)

On our way 'ome, on our way 'ome...
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 31st May 2007 18:10
The short answer is that full-screen DirectX programs are not supposed to be exited, so your program shouldn't allow you to do it. (You don't actually say if your app is full-screen or in a window).

In other words, the effect you are seeing is not good - but it is normal. You used to see it happen on early commercial DirectX games.

I can only suggest a couple of things to try, because I've not experimented with this at all.

1. Try running your program in a window if it isn't already.

2. Try re-initialising the screen with Set Display Mode on returning to the program.

3. You may also have to store all the objects positions, delete them and then reloade/recreate them.

4. If all else fails, run in full screen mode and try Disable SystemKeys to prevent the user from alt-tabbing out of your app.

I'm sure if there are any other measures you can take, someone will post and let you know.

TDK_Man

SimSmall
21
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 31st May 2007 19:33
the screen invalid() statement returns a one if the user switches out of the application, and then back into it... checking for screen invalid() every game loop (and resetting the display mode if this retuns a one) usually works, but there were some instances where the textures never restored...


Also, disabling system keys with the disable systemkeys command ofiicially has no effect on windows NT systems. (I also found it made no difference on 98 and ME either)

In short, it's horrible, I believe it doesn't happen in windowed mode. screen invalid() is the official statement used to check when wthe application has been minimised and restored, but sometimes you'll find your textures can't be restored without deleting and reloading all of your objects...
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 31st May 2007 20:26
Quote: "when I restore it, the 3D objects leave a trail as they move across the screen."


I've only experienced this when running a program in the compiler. Any executable I've created runs fine and can be Alt+tabbed out and back without any problems both windowed and full screen - even without a test for screen invalid().

Enjoy your day.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 1st Jun 2007 04:06
Hmmm... you learn something new every day!

In all these years, I never knew that the screen invalid() command even existed. I did say that I'd never experienced the problem myself...

Shows you are never too old to learn something.

TDK_Man

Robert The Robot
19
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 5th Jun 2007 14:39
Thanks for your help guys!

I've got it working now - I just had the code delete all the objects, set the display mode again and then reload the objects!

On our way 'ome, on our way 'ome...

Login to post a reply

Server time is: 2026-07-05 22:37:16
Your offset time is: 2026-07-05 22:37:16