PocketMatrix forums

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

Again the problem with 'flickering'

Ok, this is my post from 'GapiTools':

My game is flickering on PPC's, but not on the emulator.

Code:
// Start rendering:
Buffer = (unsigned short *)GXBeginDraw();

// Display an BG Image (doesn't flicker)

// Ca 5 ms later, display another image (flickers)


// Stop rendering
GXEndDraw();




I thought 'Buffer' would be working like a normal backbuffer and the image data is pushed on the screen when calling GXEndDraw();. Or should I call the GX functions before and after each image?
Do PPC's have an v-sync?


Where are the informations to avoid the flickering,
or how (when) are you calling which functions to avoid this?


Posted: Fri Mar 01, 2002 11:03 am Post subject:
Some PPCs copy the data to the screen when GXEndDraw() is called. Most PPCs just return the location of the buffer when you call GXBeginDraw() and don't do anything with GXBeginDraw().

BTW, this post really should be on the general dev forumn, since this forumn is for GAPITools, a pocketpc developement library.

Also, there was recently a post on another forumn (I forget which) about VSync on PPCs. Short version, yes there is, but it's really hard to use.

_________________
Most people don't know that "A highly technical term" is actually a highly technical term used to describe something that doesn't mean anything
[/code]
Buffer is not always a backbuffer. That is hardware dependant. On some devices GXBeginDraw returns a pointer directly to the display hardware buffer. Any modifications are displayed immediately.

There shouldn't be any flickering unless you are clearing the display and then filling it. If you must draw in that fashion, then use your own backbuffer, and blit the whole thing out to the display at once. For scrolling games it is best to blit to the display in the same orientation as the display hardware. That will eliminate diagonal tearing that would result otherwise.

Dan East
Ah thanx, I'll try it out, I thought the 'Buffer' was always a backbuffer so I wondered how the flickering could appear.
You refer to it as a 'Buffer' but it isnt described as a buffer anywhere. The docs say:

GXBeginDraw

Return Values
Pointer to start of display memory, or NULL if the display cannot be locked.

The only reference to a buffer is the variable name in your code segment. You could call the variable Elephant and it would work fine, but it doesnt make it a pointer to an elephant.
rotfl;)
It would class as a buffer either way; a frame-buffer for direct access or a back-buffer if it was to be blitted later.

You refer to it as a 'Buffer' but it isnt described as a buffer anywhere.


In MSDN, Microsoft say:

GAPI includes the GXDISPLAYPROPERTIES structure, which provides information about the video frame buffer (VFB). ... (snip) ... To continue drawing more data on the screen, call GXBEGINDRAW to get a pointer to the VFB. As soon as drawing is complete and no later, call GXENDDRAW.


Microsoft seem to think it's a buffer. Next time you're big enough to anonymously try and act like a smart-arse, get your "facts" right.

Cheers,

Refractor.
That's one of the problems I've had with GAPI: There are almost no tutorials how to use it, only 1 short and ?useless? demonstration.
simonjacobs · 05 Mar 2002, 16:20 UTC
true, are there any particular question you had? its quite easy once you get the hang of it.
Thanx, my game is almost finished so far, but there are already some features missing:
1. Sound (I've written an sound class with FMOD, but it often crashes)
2. I've rewritten my rendering part - hopefully it won't flicker anymore.
3. I don't have an rotation or scaling part for my textures, but as long as it isn't needed, I don't want to slow down the game even more.

Do you know another sound engine (or library) which works with x86 emulator, 'cause I don't have an PPC?
MikMod. It's free and the source is included in the distribution. You may want to grab Phantom's EasyCE because it contains MikMod ready to go.

Dan East
Hmm, I can't find MikMod for Windows CE...
8O