PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

how the Flip() function works?

Is there any way to know how the function CGapiDisplay::Flip() works?

I see two possible answers:

1) GAPI have two real different buffers and ::Flip() function just change the pointer to the visible area.

2) GAPI have only one buffer and when I invoke the ::Flip() function it copies a block of memory from buffer to the screen area.

Who knows the answer?

And the last question. Could I be sure that this function works the same way on *all* pocketpc devices, include the future ones?
You can check if the surface flag GDSURFACE_PRIMARY is set for the display surface (m_display). If it is set, then GapiDraw is responsible for managing the backbuffer (which is stored in RAM and copied to display on Flip). If it is not set, then GAPI is managing the backbuffer and the flip to the display. Using GAPI it is however not possible to tell if the flip is using true double buffering or if GAPI is using an offscreen buffer in RAM.

Could I be sure that this function works the same way on *all* pocketpc devices, include the future ones?


Some devices report incorrect parameters with their GAPI implementations, so no you cannot be sure.. GapiDraw is however the most widely used graphics SDK for handheld computers and if an issue is found we will correct it immediately.
Using GAPI it is however not possible to tell if the flip is using true double buffering or if GAPI is using an offscreen buffer in RAM.


Does it mean that i must redraw the *entire* backbuffer at each frame?


Currenlty I use WinAPI for our games and i'm updating just a little portion of backDC before blitting it to the primary DC. Could I use the same technic with GapiDraw? All that I need is to be sure that image in m_backbuffer after ::Flip() is the *same* as m_display.
Does it mean that i must redraw the *entire* backbuffer at each frame?


No, you don't have to redraw the entire backbuffer on each frame update...
Does this mean that on the start of each ProcessNextFrame() the content of the backbuffer is guaranteed to be what it was when the previous ProcessNextFrame() exited?

--Eric
On all of today's Pocket PCs : Yes

On Stationary PCs and some of tomorrow's Pocket PCs that use page flipping: No

:)

It's best to redraw the entire backbuffer to avoid possible future issues. Palm supports true page flipping on some devices, and that's the way we are heading with GapiDraw right now...
OOT: I would kill to have a toolkit like GapiDraw that I could use on the PC in windowed mode to write editors and other game tools. Something that would abstract the ugly DX stuff...

I use DirectX 9 in 2D to write my tools, but I really don't like it...

--Eric
Johan,

You might want to investigate how swap effects are implemented in Direct3D. This could be a nice way to expose the behavior of a flip or blit for apps like tepexob's that would benefit from a "copy" effect. For apps that don't care about the state of a back buffer after a flip, they could specify a "discard" swap effect.


cheers,
digby