Skip to main content

Crate wgame_macros

Crate wgame_macros 

Source
Expand description

Procedural macros for wgame application entry points.

Provides #[app] and #[window] macros for creating application and window entry points.

§Examples

Application entry point, followed by a single-window entry point:

#[wgame::app]
async fn main() {
    // Start tasks or create windows here.
}
#[wgame::window(size = (800, 600))]
async fn main(mut window: wgame::Window<'_>) -> wgame::Result<()> {
    while let Some(_frame) = window.next_frame().await? {}
    Ok(())
}

Attribute Macros§

app
Marks a function as the main entry point for a wgame application.
window
Marks a function as the main entry point for a wgame window.