Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 01/22/22 00:55
Lapsa's very own thread
by Lapsa. 01/21/22 08:23
Generic, dynamically growing array
by 3run. 01/18/22 15:37
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 01/18/22 15:00
Bug in NumUp/Dn
by jcl. 01/17/22 12:23
Help with plotting Lookback in Trade Mode
by degenerate_762. 01/15/22 23:43
AUM Magazine
Latest Screens
Tactics of World War I
Hecknex World
Scheherazade's Journey
Paradox Vector
Who's Online Now
7 registered members (ozgur, Zheka, AndrewAMD, gamers, NorbertSz, kawjansen, 3run), 172 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
kawjansen, Alex2052, AndreasTrader, spacenomad, coinpump
18731 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: DirectX : 3d Hardware Reset Failure [Re: jumpman] #481992
12/01/20 18:23
12/01/20 18:23
Joined: May 2009
Posts: 5,354
Caucasus
3run Online
Senior Expert
3run  Online
Senior Expert

Joined: May 2009
Posts: 5,354
Caucasus
Thank you for your time and help guys!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Re: DirectX : 3d Hardware Reset Failure [Re: jumpman] #484934
12/31/21 21:24
12/31/21 21:24
Joined: May 2005
Posts: 853
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 853
Chicago, IL
I don't know if this will help anyone else, but it seems to be the best option for my game.

Code
foreground = GetForegroundWindow();

		if(foreground!=hWnd)
		{
			beep();
			proc_mode = PROC_NOFREEZE;
			freeze_mode = 2;
			while(1)
			{
				foreground = GetForegroundWindow();
				if(foreground==hWnd)
				{
					freeze_mode = 0;
					proc_mode = PROC_GLOBAL;
					break;
				}
				wait(1);
			}
			
			wait(1);
			beep();
		}


Since my game does not need to run in the background, I just froze it whenever it was not the foreground window. It's based on Emri's code, but adjusted slightly. This is all in another while loop that I use for other things, like calculating fps and some other general purpose scripts.

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1