Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgcreatelayersurface.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgcreatelayersurface.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgcreatelayersurface.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgcreatelayersurface.html on line 8

PgCreateLayerSurface()

Create an offscreen context that a layer can display

Synopsis:

PdOffscreenContext_t *PgCreateLayerSurface(
                         int layer,
                         int surface_index,
                         int format_index,
                         unsigned short width,
                         unsigned short height,
                         unsigned long flags);

Arguments:

layer
The layer index, which must be 0 or greater.
surface_index
The surface index, which must be 0 or greater.
format_index
The image format index, which corresponds to the index used in PgGetLayerCaps().
width, height
The dimensions of the context, in pixels.
flags
Defined flags are:

Library:

ph

Description:

PgCreateLayerSurface() creates an offscreen context that can be nearby the given layer in the given format.

For layer formats that require data from more than one surface, surface_index is used to distinguish each surface.

For these layer formats:

Use these surface indices:

0
Y plane
1
U plane
2
V plane

For all other layer formats, use 0 for surface_index.


Note: You must target this function at a device by calling PdSetTargetDevice().

If a layer is reconfigured (e.g. its format is changed), previously allocated offscreen contexts might no longer be compatible with the layer.

To tell a layer to read data from a surface, call PgSetLayerSurface().


WARNING: You can't use Photon drawing functions on a surface with a format that doesn't match the current video mode.

Returns:

A pointer to a PdOffscreenContext_t structure, or NULL if an error occurred.

Errors:

EINVAL
The format, dimensions, or flags are incompatible with the given layer capabilities, or the layer or layer surface doesn't exist.
EOPNOTSUPP
The operation isn't supported.
ENOMEM
Memory allocation failed.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PdGetOffscreenContextPtr(), PdOffscreenContext_t, PdSetTargetDevice(), PgGetLayerCaps(), PgSetLayerSurface()

Layers in the Raw Drawing and Animation chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgcreatelayersurface.html on line 235

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgcreatelayersurface.html on line 235