A Rust framework for building DOME plugins.
The basic structure of every plugin using this framework is:
Cargo.toml:
```toml [package] name = "myawesomedome_plugin" description = "Really, really awesome DOME plugin written in Rust!" version = "0.1.0" authors = ["Me me@gmail.com"] edition = "2018"
[dependencies] libc = "0.2" dome_cloomnik = "0.1"
[lib] crate-type = ["cdylib"] ```
lib.rs:
```rust use domecloomnik::{Context, WrenVM, registermodules};
extern "C" fn PLUGINonInit(getapi: *mut libc::cvoid, ctx: *mut libc::cvoid) -> libc::cint { unsafe { domecloomnik::initplugin( getapi, ctx, domecloomnik::Hooks { oninit: Some(oninit), preupdate: Some(preupdate), postupdate: Some(postupdate), predraw: Some(predraw), postdraw: Some(postdraw), onshutdown: Some(on_shutdown), } ) } }
fn oninit(ctx: Context) -> Result<(), ()> { registermodules! { ctx, ... };
// ...
}
fn pre_update(ctx: Context) -> Result<(), ()> { // ... }
fn post_update(ctx: Context) -> Result<(), ()> { // ... }
fn pre_draw(ctx: Context) -> Result<(), ()> { // ... }
fn post_draw(ctx: Context) -> Result<(), ()> { // ... }
fn on_shutdown(ctx: Context) -> Result<(), ()> { // ... } ```
Go ahead, and start with learning DOME plugins from the docs. Don't worry, much of the things there will apply to doom_cloomnik too!