|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
Rounded native output uses fractional anti-aliasing, independently of the integer-coverage CPU renderer and exact command replay. More...
Data Structures | |
| struct | rmgui_native_status_t |
| Last prepare result and used attempt counters, retained through cancel/consume until the next prepare. More... | |
| struct | rmgui_native_pool_t |
| One pool tier: count slots of width x height texels. More... | |
| struct | rmgui_native_storage_desc_t |
| Fixed create-time storage. More... | |
| struct | rmgui_native_external_binding_t |
| Borrowed sampled RGBA8 image replacing CPU upload for one pinned framebuffer identity. More... | |
| struct | rmgui_native_external_t |
| Borrowed image binding, immutable through consume/cancel. More... | |
| struct | rmgui_native_desc_t |
| GPU payload reservation (no driver alignment, metadata, handle pools, host targets, external images or CPU arrays): More... | |
| struct | rmgui_native_prepare_desc_t |
| Device-pixel frame inputs, borrowed through consume/cancel. More... | |
| struct | rmgui_native_stats_t |
| Last successfully consumed frame, except submissions/draws accumulate. More... | |
Typedefs | |
| typedef rmgui_native_result_t(*) | rmgui_native_readback_fn(void *userdata, sg_image image, rmgui_rect_t region, void *pixels, size_t stride) |
| Host readback runs outside passes after GPU capture. | |
| typedef struct rmgui_native | rmgui_native_t |
| Independent float GPU renderer. | |
Functions | |
| rmgui_native_result_t | rmgui_native_create (rmgui_native_t **out, const rmgui_native_desc_t *desc) |
| Allocate fixed CPU storage and backend handles outside passes. | |
| rmgui_native_result_t | rmgui_native_storage_bytes (const rmgui_native_desc_t *desc, size_t max_image_size_2d, size_t out_bytes[RMGUI_NATIVE_MEMORY_CLASSES]) |
| Pure, allocation-free GPU payload sizing; does not require sg_setup. | |
| void | rmgui_native_release (rmgui_native_t *native) |
| Release owned handles/storage outside passes; NULL is a no-op. | |
| rmgui_native_result_t | rmgui_native_prepare (rmgui_native_t *native, rmgui_draw_stream_t *stream, const rmgui_native_prepare_desc_t *desc) |
| Validate the complete sealed tree and all native capabilities before GPU work. | |
| rmgui_native_result_t | rmgui_native_consume (rmgui_native_t *native) |
| Consume once inside a host single-sample RGBA8/no-depth pass. | |
| void | rmgui_native_cancel (rmgui_native_t *native) |
| Cancel outside passes; release input and roll back pending atlas/captures. | |
| rmgui_native_stats_t | rmgui_native_stats (const rmgui_native_t *native) |
| Return committed counters by value, or all zero for NULL. | |
| rmgui_native_status_t | rmgui_native_status (const rmgui_native_t *native) |
| Last prepare diagnostic, retained through consume/cancel. | |
Rounded native output uses fractional anti-aliasing, independently of the integer-coverage CPU renderer and exact command replay.
Native rounded acceptance compares independent AA geometry while retaining exact clipping.
Constants
Counter-array extent follows the complete public command vocabulary.
| typedef rmgui_native_result_t(*) rmgui_native_readback_fn(void *userdata, sg_image image, rmgui_rect_t region, void *pixels, size_t stride) |
Host readback runs outside passes after GPU capture.
region uses top-left image coordinates, pixels is renderer-owned writable RGBA8 staging with stride bytes per row, not the caller's capture framebuffer. Return OK only after pixels are complete; this callback may synchronize the GPU and stall. It must not commit, allocate renderer storage or retain pointers.
| typedef struct rmgui_native rmgui_native_t |
Independent float GPU renderer.
All calls run on the host sg thread; create, prepare, cancel and release run outside passes. Release before sg_shutdown.
Failures submit no consuming draws; prepare validates the complete stream before uploads or offscreen passes.
REFUSED identifies an unsupported op.
Fixed storage that prevented prepare from completing; NONE for other errors.
| enum rmgui_native_alpha_t |
Encoded-space source representation; RGBA8 sampling never enables sRGB decode.
Straight sources preserve hidden RGB for nearest copy; filtered compositing requires premultiplied data. R8 denotes coverage, not an RGBA color.
| Enumerator | |
|---|---|
| RMGUI_NATIVE_STRAIGHT_RGBA | |
| RMGUI_NATIVE_PREMULTIPLIED_RGBA | |
| RMGUI_NATIVE_R8 | |
| anonymous enum |
| rmgui_native_result_t rmgui_native_create | ( | rmgui_native_t ** | out, |
| const rmgui_native_desc_t * | desc ) |
Allocate fixed CPU storage and backend handles outside passes.
Positive, overflow-safe capacities required. Failure leaves *out unchanged.
| rmgui_native_result_t rmgui_native_storage_bytes | ( | const rmgui_native_desc_t * | desc, |
| size_t | max_image_size_2d, | ||
| size_t | out_bytes[RMGUI_NATIVE_MEMORY_CLASSES] ) |
Pure, allocation-free GPU payload sizing; does not require sg_setup.
max_image_size_2d is the backend limit (at least 1024). Uses the same validated layout as create and committed gpu_bytes. Failure leaves out_bytes unchanged. Classes match stats; unused surfaces are layer, retained field root is geometry. Consume may reclassify surface bytes as root/blur without changing the sum. Staging is included: this is not resident VRAM or a promise about driver usage.
| void rmgui_native_release | ( | rmgui_native_t * | native | ) |
Release owned handles/storage outside passes; NULL is a no-op.
| rmgui_native_result_t rmgui_native_prepare | ( | rmgui_native_t * | native, |
| rmgui_draw_stream_t * | stream, | ||
| const rmgui_native_prepare_desc_t * | desc ) |
Validate the complete sealed tree and all native capabilities before GPU work.
No silent fallback. Failure releases the stream and preserves capture outputs. Stream/source/table lifetimes extend through consume/cancel. Uploads/offscreen work require a host commit before another prepare.
| rmgui_native_result_t rmgui_native_consume | ( | rmgui_native_t * | native | ) |
Consume once inside a host single-sample RGBA8/no-depth pass.
No allocation. Crossing a host commit or mutating sealed input refuses before any draws. Successful consume publishes CPU captures and commits frame counters.
| void rmgui_native_cancel | ( | rmgui_native_t * | native | ) |
Cancel outside passes; release input and roll back pending atlas/captures.
After GPU work a host commit is still required. NULL is a no-op.
| rmgui_native_stats_t rmgui_native_stats | ( | const rmgui_native_t * | native | ) |
Return committed counters by value, or all zero for NULL.
| rmgui_native_status_t rmgui_native_status | ( | const rmgui_native_t * | native | ) |
Last prepare diagnostic, retained through consume/cancel.
Command index is local to the identified opcode's stream. NULL/before prepare returns ARGS, capacity NONE, RMGUI_CMD_COUNT/SIZE_MAX and zero attempted counters.