This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Maybe a problem with 2.0 on the desktop


Maybe a problem with 2.0 on the desktop

Postby tedson » May 4, 2003 @ 4:02pm

tedson
pm Member
 
Posts: 85
Joined: May 29, 2002 @ 8:22pm


Postby Johan » May 4, 2003 @ 7:40pm

Yes,

One or more of the surfaces (probably the back buffer) are stored in video memory and have been lost when you switched to the desktop. The reason for this behaviour is that it will work exactly the same if a game runs on a hardware-accelerated PDA and is minimized...

You can simply call CGapiDisplay::SurfacesAreLost() on each ProcessNextFrame(). If it returns GDERR_LOSTSURFACE one or more video surfaces have been destroyed. You can then call CGapiDisplay::RestoreAllSurfaces() to restore all video surfaces (unfortunately the contents of the surfaces have also been destroyed and you need to reload all bitmaps etc using CreateSurface again - GapiDraw will not reallocate memory if the surface size hasn't changed if CreateSurface is called multiple times).

It's a good idea to not check for lost surfaces and restore them if the application is minimized (since restoring the backbuffer will fail on each try).

I'm currently working on a detailed documentation on the HW implementation, with a number of "do"s and "don't"s...
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby tedson » May 4, 2003 @ 8:44pm

tedson
pm Member
 
Posts: 85
Joined: May 29, 2002 @ 8:22pm


Postby Johan » May 4, 2003 @ 8:59pm

Unfortunately you still need to check if the back buffer was relocated during the Flip(). It can only be relocated on some GAPI implementations, and as of yet no GAPI-implementation is known to do so (but that might change). Perhaps if it was called "GDERR_GAPIBUFFERLOST" it would be a better term... Hmm...

Actually.. I think I'll change the description of GDERR_BACKBUFFERLOST to GDERR_GAPIBUFFERLOST in gapidraw.h when I add documentation to the GapiDraw 2.00 package.. Then it's more clear of what's happening...

If all surfaces except the back buffer are located in system memory you don't need to re-create them.. You only need to call CreateSurface() again on those that are located in video memory... By the way. If you do any alpha blends (opacity etc) on the backbuffer you will get a real speedup if you store that one also in system memory (GDDISPLAY_BACKBUFFERSYSMEM).

I really, really need to finish document with all these things listed soon...
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Johan » May 4, 2003 @ 9:17pm

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby tedson » May 4, 2003 @ 10:12pm

tedson
pm Member
 
Posts: 85
Joined: May 29, 2002 @ 8:22pm


Postby Johan » May 4, 2003 @ 10:17pm

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby tedson » May 4, 2003 @ 10:32pm

tedson
pm Member
 
Posts: 85
Joined: May 29, 2002 @ 8:22pm


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum