CoglOnscreenTemplate: Describe a template for onscreen framebuffers

CoglOnscreenTemplate: Describe a template for onscreen framebuffers

Synopsis

                    CoglOnscreenTemplate;
CoglBool            cogl_is_onscreen_template           (void *object);

CoglOnscreenTemplate * cogl_onscreen_template_new       (void);
void                cogl_onscreen_template_set_has_alpha
                                                        (CoglOnscreenTemplate *onscreen_template,
                                                         CoglBool has_alpha);
void                cogl_onscreen_template_set_swap_throttled
                                                        (CoglOnscreenTemplate *onscreen_template,
                                                         CoglBool throttled);
void                cogl_onscreen_template_set_samples_per_pixel
                                                        (CoglOnscreenTemplate *onscreen_template,
                                                         int n);

Description

Details

CoglOnscreenTemplate

typedef struct _CoglOnscreenTemplate CoglOnscreenTemplate;

cogl_is_onscreen_template ()

CoglBool            cogl_is_onscreen_template           (void *object);

Gets whether the given object references a CoglOnscreenTemplate.

object :

A CoglObject pointer

Returns :

TRUE if the object references a CoglOnscreenTemplate and FALSE otherwise.

Since 1.10

Stability Level: Unstable


cogl_onscreen_template_new ()

CoglOnscreenTemplate * cogl_onscreen_template_new       (void);

cogl_onscreen_template_set_has_alpha ()

void                cogl_onscreen_template_set_has_alpha
                                                        (CoglOnscreenTemplate *onscreen_template,
                                                         CoglBool has_alpha);

Requests that any future CoglOnscreen framebuffers derived from this template should have an alpha channel if has_alpha is TRUE. If has_alpha is FALSE then future framebuffers derived from this template aren't required to have an alpha channel, although Cogl may choose to ignore this and allocate a redundant alpha channel.

By default a template does not request an alpha component.

onscreen_template :

A CoglOnscreenTemplate template framebuffer

has_alpha :

Whether an alpha channel is required

Since 1.16

Stability Level: Unstable


cogl_onscreen_template_set_swap_throttled ()

void                cogl_onscreen_template_set_swap_throttled
                                                        (CoglOnscreenTemplate *onscreen_template,
                                                         CoglBool throttled);

Requests that any future CoglOnscreen framebuffers derived from this template should enable or disable swap throttling according to the given throttled argument.

onscreen_template :

A CoglOnscreenTemplate template framebuffer

throttled :

Whether throttling should be enabled

Since 1.10

Stability Level: Unstable


cogl_onscreen_template_set_samples_per_pixel ()

void                cogl_onscreen_template_set_samples_per_pixel
                                                        (CoglOnscreenTemplate *onscreen_template,
                                                         int n);

Requires that any future CoglOnscreen framebuffers derived from this template must support making at least n samples per pixel which will all contribute to the final resolved color for that pixel.

By default this value is usually set to 0 and that is referred to as "single-sample" rendering. A value of 1 or greater is referred to as "multisample" rendering.

Note

There are some semantic differences between single-sample rendering and multisampling with just 1 point sample such as it being redundant to use the cogl_framebuffer_resolve_samples() and cogl_framebuffer_resolve_samples_region() apis with single-sample rendering.

onscreen_template :

A CoglOnscreenTemplate template framebuffer

n :

The minimum number of samples per pixel

Since 1.10

Stability Level: Unstable