PgFlushCx, PgFFlushCx
[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

PgFlush(), PgFFlush(), PgFlushCx(), PgFFlushCx()

Explicitly flush the current draw buffer

Synopsis:

int PgFlush( void );

int PgFFlush( unsigned int flags );

int PgFlushCx( void *dc );

int PgFFlushCx( void *dc,
                unsigned int flags );

Library:

ph

Description:

These functions flush the current draw buffer and then clear it. Most applications call PgFlush*(); you need to call PgFFlush*() only if you need to specify the type of draw event.

Normally, you set flags to Ph_NORMAL_DRAW; this is the same as calling PgFlush*(). But if your application has received an expose event with a subtype of Ph_CAPTURE_EXPOSE, you should encapsulate your drawing events by calling

PgFFlush( Ph_START_DRAW );

before drawing anything, and

PgFFlush( Ph_DONE_DRAW );

after the entire exposed region has been redrawn. If you're using widgets, PtEventHandler() makes both these calls automatically.

Any function that builds a command in the draw buffer calls PgFlush*() automatically when the draw buffer becomes full.

PgFlush() and PgFFlush() work on the current draw context, while you can specify the draw context dc for PgFlushCx() and PgFFlushCx().

Returns:

0
Successful completion.
-1
An error occurred.

Examples:

/*
 * Place a group of 3 lines in the draw buffer
 */
PgDrawILine( 100, 100, 200, 300 );
PgDrawILine( 200, 300, 700, 700 );
PgDrawILine( 700, 700, 0,   0   );

/*
 * Emit a draw event that contains those 3 lines
 */
PgFlush();

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgClearDrawBuffer*(), PgSetDrawBufferSize*(), PhEvent_t


[Previous] [Contents] [Index] [Next]