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.

Dark GDK / a couple of other things im wondering about

Author
Message
Sephnroth
20
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 14th Jul 2005 03:14
I have a few other problems im curious about which are all to do with asthetics basically.

a) windowed mode in different resolutions, how can I center it? the big resolutions like 1024x768 go right off the screen until i manually move the window myself - i seem to recall some command or the other for positioning the window but to use it properly i would need to know the desktop width and height that the user was using. Not sure how to get those :/

b) Is there any way i can make alt-tabbing full screen applications safe? atm if you minimise a full screen darksdk program and then come back more often than not it blows up and sometimes causes a lock up where there is a message box you cant get at. This is a bit off but im guessing there is probably some way around it? I notice a command to check if the screen is invalid - is the problem something like when you minimise it keeps trying to execute anyway but its drawing to an invalid surface and thus the boom? should I encase ALL code in my program in an if checking if the screen is invalid?

I have some more.. but i think that will do for now ^^
Thanks for any advice.

Mike Johnson
TGC Developer
20
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 14th Jul 2005 03:25
For the first problem you can use the dbSetWindowPosition function.

Add in a call to dbScreenInvalid each frame. If this returns a value of 1 then it is likely someone has alt tabbed out of the application and as a result of this you may lose some data such as textures and objects. When this happens you can delete objects and reload them manually. Ideally we need to change this in a future update so that this is all handled automatically and you don't need to do anything about it.
Sephnroth
20
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 14th Jul 2005 04:53
Thanks for the reply Mike - I look forward to when the engine handles the alt tabbing thing itself

About dbSetWindowPosition - I knew it was there but just what do I set the position to? I mean its generally a case of when a program opens its window is centered to your screen. How can I center the window without knowing the users desktop width and height? I guess setting the position to the top left is better than nothing, but i would really like to center it

OSX Using Happy Dude
19
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Jul 2005 04:59
You would need to get the users desktop window and height - which is easy enough.
You then need to get the width and height of your window, including any and all borders
Subtract one from the other and divide by 2

George "Dubya" Bush says: 'I play AtomZ to keep my brain supple. Here it found be:http://www.nichkk.plus.com/'
http://spaces.msn.com/members/BouncyBrick/
Sephnroth
20
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 14th Jul 2005 05:00
"which is easy enough."

i already knew everything except for that one easy enough bit XD Its funny, I know enough about the winapi and whatnot to write that huge tutorial on it, but i honestly do not know how to get the width and height of the users desktop. My searching didnt bare any usful fruit either :/ Please pass on the secret XD

OSX Using Happy Dude
19
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Jul 2005 05:07
I will - hang on!

George "Dubya" Bush says: 'I play AtomZ to keep my brain supple. Here it found be:http://www.nichkk.plus.com/'
http://spaces.msn.com/members/BouncyBrick/
OSX Using Happy Dude
19
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Jul 2005 05:09 Edited at: 14th Jul 2005 05:14
GetWindowRect(GetDesktopWindow(),&rect);

For more information, you've got GetWindowInfo and GetWindowExtEx

GetSystemMetrics to get the width and height of title bars, borders etc etc

George "Dubya" Bush says: 'I play AtomZ to keep my brain supple. Here it found be:http://www.nichkk.plus.com/'
http://spaces.msn.com/members/BouncyBrick/
IanM
Retired Moderator
20
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jul 2005 05:17
You can get the screen dimensions by using the GetSystemMetrics() function with values of SM_CXSCREEN and SM_CYSCREEN too.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
OSX Using Happy Dude
19
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Jul 2005 05:44
Quite true...

George "Dubya" Bush says: 'I play AtomZ to keep my brain supple. Here it found be:http://www.nichkk.plus.com/'
http://spaces.msn.com/members/BouncyBrick/
Sephnroth
20
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 14th Jul 2005 05:50
thankyou both of you, been a big help

Login to post a reply

Server time is: 2023-02-02 14:40:38
Your offset time is: 2023-02-02 14:40:38