# Mawida

A small, code-first game framework in Rust, built on wgpu. The programming model
is XNA's: implement a `Game` trait with `init` / `update` / `draw`, and a
`Context` carries the GPU and input handles. No editor, no scene format. You
write Rust.

2D today, with the seams cut so that 3D is additive and VR is reachable. The name
is Mapudungun for "mountain."

## Quick start

```rust
use mawida::{run, AppConfig, Camera, Color, Context, Game, GameTime, Key, OrthographicCamera, Result};
use mawida::drawable::Sprite;

struct MyGame { x: f32, y: f32, cam: OrthographicCamera }

impl Game for MyGame {
    fn update(&mut self, ctx: &mut Context, time: GameTime) -> Result<()> {
        if ctx.input().is_down(Key::Right) { self.x += 200.0 * time.delta_seconds(); }
        Ok(())
    }
    fn draw(&mut self, ctx: &mut Context) -> Result<()> {
        let s = Sprite::solid(Color::WHITE, self.x, self.y, 64.0, 64.0);
        ctx.draw(&s, &self.cam as &dyn Camera)
    }
}

fn main() -> Result<()> {
    run(MyGame { x: 100.0, y: 100.0, cam: OrthographicCamera::new(800.0, 600.0) },
        AppConfig::default())
}
```

Run the bundled example:

```
cargo run --example hello_quad
```

Run the pure-logic tests without pulling the GPU stack:

```
cargo test --no-default-features
```

## Status

This is a v0.1 skeleton. The pure-logic core (math, time, color, transform,
input, camera, drawable, content) is unit-tested. The runtime layer (wgpu
backend, winit app, audio) was authored against current crate versions
(wgpu 29.0.3, winit 0.30.13, verified 2026-06-27) but needs a first compile on a
real machine; spots likely to need a version tweak are tagged `// VERIFY:`.

See CLAUDE.md for working conventions. The full design rationale, the 2D/3D/VR
seam strategy, and the wgpu/Vulkan/OpenXR plan live in the companion docs repo
(fortega/mawida-docs), kept separate so this repo stays code-only.

## License

BSD-2-Clause. Copyright (c) 2026 Francisco R. Ortega, Ph.D.

Author: Dr. Francisco R. Ortega.
