gf_surface_reattach()

Recycle a surface previously created with gf_surface_attach()

Synopsis:

#include <gf/gf.h>

int gf_surface_reattach( gf_surface_t            surface,
                         int                     w,
                         int                     h,
                         int                     stride,
                         const gf_palette_t *    palette,
                         uint8_t *               ptr,
                         unsigned                flags );

Arguments:

surface
The handle of the surface that was created with gf_surface_attach()
w, h
The new height and width of the surface, in pixels
stride
Number of bytes per scanline in the new memory buffer
palette
A pointer to a gf_palette_t structure, which represents the new surface palette. You may pass NULL if the surface format is not palette-based (GF_FORMAT_PAL8), or if you don't want to change the palette associated with the surface.
ptr
A pointer to the new memory buffer containing image data.
flags
Flags affecting the surface properties. None are defined; pass 0.

Library:

gf

Description:

This function recycles a surface that was previously created with gf_surface_attach(). This function allows a different region of memory to be associated with the specified surface. The format of the data must remain the same.

This function is designed to be fast, and avoids re-allocation of memory in situations where you want to re-use a surface repeatedly.

Returns:

GF_ERR_OK
Success.
GF_ERR_PARM
The characteristics of the specified palette didn't match the palette that was originally passed to gf_surface_attach()

Classification:

QNX Graphics Framework

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

gf_palette_t, gf_surface_attach(), gf_surface_create(), gf_surface_create_layer(), gf_surface_free()