Create a surface that a layer can target
int gf_surface_create_layer( gf_surface_t *psurface,
const gf_palette_t *palette,
uint32_t flags );
- An address where the function can store a handle to the surface.
- An array of handles to the layers that you would like to be able to safely target the surface.
- The number of handles in the layer array.
- The surface index, which used only in the case of planar layer formats (for example YUV) that require a surface for each plane. For nonplanar surfaces (the usual case) you should always pass 0 for this parameter.
- w, h
- The width and height of the surface, in pixels.
- The gf_format_t display format of the surface. If you're using a packed type, you should pass the non-endian-specific variant to make your application more portable.
- A pointer to a gf_palette_t structure, which represents the surface palette. You can pass NULL if the surface format isn't palette-based (GF_LAYER_FORMAT_PAL8).
- Flags affecting the surface allocation. See gf_surface_create().
The GF_SURFACE_CREATE_CPU_LINEAR_ACCESSIBLE and GF_SURFACE_CREATE_CPU_FAST_ACCESS flags
are not compatible with the Carmine (devg-carmine.so) graphics driver.
This function creates a new surface that can be targetted by the specified layer. You must use this function if you plan on binding the surface directly to one or more layers via gf_layer_set_surfaces(). It provides additional hardware checking to verify that the layer can target the surface.
If the surface is going to be used only as a rendering “scratchpad” for offscreen rendering, you can use gf_surface_create() instead.
- Memory-allocation failure.
- Unable to satisfy the criteria; verify that the pixel format meets the requirements set out by the flags for the given hardware.
- Error communicating with io-display. Check to ensure io-display is still running. The sloginfo utility may provide more information.
QNX Graphics Framework