DVUI

App

For apps that want dvui to provide the mainloop which runs these callbacks.

In your root file, have a declaration named "dvui_app" of this type:

pub const dvui_app: dvui.App = .{ .initFn = AppInit, ...};

Also must use the App's main, panic and log functions:

pub const main = dvui.App.main;
pub const panic = dvui.App.panic;
pub const std_options: std.Options = .{
    .logFn = dvui.App.logFn,
};

Fields

#
config:AppConfig

The configuration options for the app, either directly or a function that

initFn:?fn (*dvui.Window) anyerror!void

Runs before the first full frame, allowing for configuring the Window.

deinitFn:?fn () void

Runs when the app is exiting, before Window.deinit().

frameFn:frameFunction

Runs once every frame between Window.begin and Window.end

Types

#

Functions

#
get

Used internally to get the dvui_app if it's defined

Constants

#
main

The root file needs to expose the App main function:

panic

The root file needs to expose the App panic function:

logFn

Some backends, like web, cannot use stdout and has a custom logFn to be used.

Variables

#
main_init

The init arg passed into main. null if not available (like on web).

Aliases

#
App

For apps that want dvui to provide the mainloop which runs these callbacks.