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 / Minimizing Full Screen

Author
Message
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 26th Jun 2006 17:31
Howcome whenever I try minimizing my game when its full screen, my app either freezes, or when it does minimize, when I try going back to it, the game crashes?

Current Project: CTA Beta
Lines: 762
Last Updated: 6/24/06 at 1:26 PM EST.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 26th Jun 2006 18:12
Probably because both texture and video memory have been released, so when you swap back, you will need to reload ALL models and textures into memory. There's a function in the Display header that tells you if your application was Swapped or minimized. By checking if this flag becomes true, you can reload all the resources back in. This should stop your app from crashing.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 26th Jun 2006 18:22
Will I need to reload sounds and images as well?
Also if i had them as a sprite, do I need to remake the sprites, and set them to where they were etc, or do I just need to reload them.

Current Project: CTA Beta
Lines: 762
Last Updated: 6/24/06 at 1:26 PM EST.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 26th Jun 2006 18:25
Sounds, I'm unsure, but definately textures and models.

You'll probably need to recreate them and place them again, as all the memory is relinquished from DX when a full screen swap is made.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 26th Jun 2006 18:26

Sounds like no easy task.
Ill need to find a way to remember what is where at any given time.

Thanks for the info

Current Project: CTA Beta
Lines: 762
Last Updated: 6/24/06 at 1:26 PM EST.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Jun 2006 01:19
You need to reload *everything* that deals with DirectX.

Models, Textures, Sprites, Sounds, Bitmaps, Lights, Main display, Backdrop, and maybe a few other things I've probably forgotten. Then you have to reposition/rotate everything ... and you can't restart your sounds from where they left off (there's no way to tell how far through the sound was).

Basically, it's more trouble than it's worth - stick with a fullscreen windowed mode, and avoid the whole mess.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 27th Jun 2006 01:52
LOL, good point!

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 27th Jun 2006 05:19
Good Idea.
But how to some games not crash when they are minimized?

Actualy most games work fine when being minimized.
Is it due to extreme programming, or just something that wasnt taken into account when writing the GDK.

Current Project: CTA Beta
Lines: 762
Last Updated: 6/24/06 at 1:26 PM EST.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 27th Jun 2006 12:56
Oh, it was taken into account (the screen invalid() function), but most programs reload everything - its why there is usually a pause before the screen comes up again. Its also why there is usually a pause when you select a different resolution.

Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Dont do anything I wouldn't do. But if you do, take pictures.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 27th Jun 2006 13:27
Quote: "Its also why there is usually a pause when you select a different resolution"


This is definately true of having to recreate object and image media. Creating a cube, swapping resolution and then probing for the existance of the cube, will yield false. Same for textures and other DX related resources.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Jun 2006 00:03
If you want to allow someone to minimise your app, then you pretty much have to run in a windowed mode - just make the window cover the whole display.

For free Plug-ins and source code http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-11-19 06:53:12
Your offset time is: 2024-11-19 06:53:12