A simple, cross-platform graphics/UI engine framework with a minimal interface.
Update your Cargo.toml
file to include pix-engine:
pix-engine = "0.2.0"
The default driver is sdl2. Future versions will support wasm. To use it:
pix-engine = {
version = "0.2.0",
default-features = false,
features = ["wasm-driver"],
}
In order to use the PixEngine, you need to implement the State
interface on your
application struct. There are three methods, only one of which is required:
Here's an example app skeleton:
``` struct App { // Some data fields }
impl App { fn new() -> Self { Self { // Data initialization } } }
impl State for App {
fn onstart(&mut self, data: &mut StateData) -> PixEngineResult
pub fn main() { let app = App::new(); let width = 800; let height = 600; let vsync = true; let mut engine = PixEngine::new( "App Title".to_string(), app, 800, 600, vsync ).expect("valid engine"); engine.run().expect("engine run"); } ```
See the github issue tracker.
PixEngine
is licensed under the GPLv3 license. See the LICENSE.md
file in the root for a copy.
For issue reporting, please use the github issue tracker. You can contact me directly here.
For issue reporting, please use the github issue tracker. You can contact me directly here.
Implementation heavily inspired by OneLoneCoder and his amazing olcPixelGameEngine project.
Also heavily influenced by p5js.