rhachis-run-macro

Crates.iorhachis-run-macro
lib.rsrhachis-run-macro
version0.3.1
sourcesrc
created_at2022-09-22 03:50:13.023252
updated_at2023-01-31 12:04:10.201265
descriptionA proc macro for the Rhachis game library
homepage
repository
max_upload_size
id671410
size3,509
SalsaGal (SalsaGal)

documentation

README

The run macro is a shorthand for making a main function.

You use it by prefixing your Game implementing struct with #[rhachis::run]. The following code sample:

use rhachis::*;
use rhachis::graphics::EmptyRenderer;

#[rhachis::run]
struct Run(EmptyRenderer);

impl Game for Run {
    // ...
}

is evaluated to:

use rhachis::*;
use rhachis::graphics::EmptyRenderer;

fn main() {
    Run::run()
}

struct Run(EmptyRenderer);

impl Game for Run {
    // ...
}

The main function is very often the same in all Rhachis projects which is why this shorthand is available, but you can still implement the main function yourself.

Commit count: 0

cargo fmt