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

PdCreateOffscreenContext()

Create an offscreen context in video RAM

Synopsis:

PdOffscreenContext_t *PdCreateOffscreenContext(
                         unsigned long ImageType,
                         unsigned short width,
                         unsigned short height, 
                         unsigned long flags );

Library:

ph

Description:

This function creates an offscreen context in video RAM. ImageType must currently be 0 to have the image type defined by the current video mode.

The width and height are the dimensions of the context in pixels, and the flags argument is a set of additional parameters to be used in the creation of the context.


Note: You must target this function at a specific card by calling PdSetTargetDevice(). PdCreateOffscreenContext() blocks until the operation is complete.

The flags include:

Pg_OSC_CRTC_SAFE
Tells the driver that you want to be able to point the CRT at this context at a later date (using PgSwapDisplay()).

The driver may change the dimensions and/or image type of the context in order to comply with this flag.

Pg_OSC_MAIN_DISPLAY
Create an offscreen context from the currently displayed screen. It doesn't make a new offscreen context in video ram, but just wraps the displayed screen with a PdOffscreenContext_t structure.
Pg_OSC_MEM_PAGE_ALIGN
Ensure that the offscreen context that's created is aligned to __PAGESIZE (4K on an x86). You need to specify this flag in order to use PdGetOffscreenContextPtr() with this context.

Returns:

A pointer to a PdOffscreenContext_t, or NULL.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PdDupOffscreenContext(), PdGetOffscreenContextPtr(), PdOffscreenContext_t, PdSetOffscreenTranslation(), PdSetTargetDevice(), PgContextBlit(), PgSwapDisplay(), PhDCCreate(), PhDCRelease()

"Video memory offscreen" in the Raw Drawing and Animation chapter of the Photon Programmer's Guide


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