Skip to content

cf_app_set_present_mode

Category: app
GitHub: cute_app.h


Sets the swapchain present mode via the graphical backend (if supported).

bool cf_app_set_present_mode(CF_PresentMode mode);
Parameters Description
mode The present mode to switch to -- CF_PRESENT_MODE_IMMEDIATE, CF_PRESENT_MODE_VSYNC, or CF_PRESENT_MODE_MAILBOX.

Return Value

Returns true if mode was actually applied by the backend. Returns false if the backend rejected the request (e.g. mailbox is unsupported on the Metal backend), in which case the present mode is left unchanged -- see cf_app_get_present_mode. CF_PRESENT_MODE_VSYNC is always supported.

Remarks

Present modes are mutually exclusive -- there is only ever one active mode at a time. Mailbox is similar to vsync but with reduced latency: when rendering too quickly the frame may be updated more than once before it is sent off the GPU.

cf_app_get_canvas
cf_app_set_canvas_size
cf_app_get_canvas_width
cf_app_get_present_mode
CF_PresentMode