On this page

gfx.h

The backend neutral device. No graphics api type crosses this header, and the backend is chosen at runtime.

#include "isolenui/gfx/gfx.h". The guide starts at Choosing a backend.

Switch listeners

Explained in Switching live.

gfx_switch_stepgfx_switch_leavinggfx_switch_enteredgfx_switch_fngfx_switch_listengfx_switch_unlistengfx_desc::validate

Present pacing

Explained in A device without the ui.

gfx_desc::present_hzgfx_desc::present_depthgfx_set_present

Zoom view

Explained in A device without the ui.

gfx_viewgfx_frame_draw_view

Transparency

Explained in A device without the ui.

gfx_desc::transparentgfx_set_transparentgfx_transparentgfx_surface_alpha

Backend ids

Explained in Choosing a backend.

gfx_backend_idgfx_backend_autogfx_backend_vulkangfx_backend_metalgfx_backend_d3d12gfx_backend_cpugfx_backend_countgfx_backend_infogfx_backend_listgfx_backend_checkgfx_backend_namegfx_backend_parsegfx_backend_order

Status codes

Explained in Choosing a backend.

gfx_statusgfx_okgfx_not_compiledgfx_unavailablegfx_init_failedgfx_invalidgfx_replay_failedgfx_status_text

Switching

Explained in Switching live.

gfx_switchgfx_backend

Device and frames

Explained in A device without the ui.

gfx_descgfx_desc_defaultgfx_desc::capsgfx_devicegfx_opengfx_closegfx_window_ofgfx_set_vsyncgfx_set_cleargfx_resizegfx_wait_idlegfx_framegfx_frame_begingfx_frame_drawgfx_frame_end

Assets and stats

Explained in Assets and handles.

gfx_image_loadgfx_image_rgbagfx_image_sizegfx_image_freegfx_image_descgfx_image_creategfx_image_flaggfx_image_no_mipsgfx_image_streamedgfx_image_refillgfx_image_updategfx_image_update_rectgfx_external_imagegfx_image_externalgfx_svg_loadgfx_svg_sizegfx_svg_freegfx_font_bindgfx_font_freegfx_statsgfx_stats_get

Example

backends_choose.cpp
#include "isolenui/gfx/gfx.h"

#include <stdio.h>

// list every backend id and say what this build carries and what this
// machine can actually run right now
static void print_backends(void)
{
    gfx_backend_info info[gfx_backend_count];
    const uint32_t n = gfx_backend_list(info, gfx_backend_count);
    for (uint32_t i = 0; i < n; ++i) {
        const gfx_status status = gfx_backend_check(info[i].id);
        printf("%-8s compiled=%d available=%d check=%s\n", info[i].name,
               int(info[i].compiled), int(info[i].available),
               gfx_status_text(status));
    }
}

// the command line's --backend name funnels through gfx_backend_parse
// before it ever reaches gfx_desc::preferred or gfx_open
static gfx_backend_id backend_from_flag(const char* name)
{
    const gfx_backend_id id = gfx_backend_parse(name);
    if (id == gfx_backend_count) {
        // not a backend name at all, fall back to auto
        return gfx_backend_auto;
    }
    return id;
}

// the order gfx_backend_auto walks on this platform, first valid one wins,
// which is also the order gfx_open falls back along on a refused preference
static void print_fallback_order(void)
{
    gfx_backend_id order[gfx_backend_count];
    const uint32_t n = gfx_backend_order(order, gfx_backend_count);
    for (uint32_t i = 0; i < n; ++i) {
        printf("%u: %s\n", i, gfx_backend_name(order[i]));
    }
}

Last updated 23 October 2026