The storm engine is a simple 2D renderer designed for performance. It currently features an OpenGL 3.3 backend and supports Windows, Linux, and Mac.
The engine: is experimental and will change at any time, compiles with nightly, and requires SDL build. For Windows, SDL is included automatically. On Mac and Linux, follow the instructions here to setup SDL.
This example will render a white square in about the center of the screen with text below it.
```rust use crate::cgmath::; use storm::time::; use storm::*;
fn main() { // Create the engine context and describe the window. Engine::start( WindowSettings { title: String::from("Storm: Square"), size: Vector2::new(1280, 1024), resizable: true, }, game, ); }
fn game(mut engine: Engine) { // Tick at 144 ticks per second. let mut clock = Clock::new(144); // Create a batch to draw on. Batches persist between engine.windowcommit()'s. let screen = engine.batchcreate(&BatchSettings::default()); { // Add all the sprites we want to draw to a vec. let mut sprites = Vec::new(); sprites.push(Sprite::default()); // Assign the sprites we want to draw to a batch. engine.spriteset(&screen, &sprites); } { // Add all the strings we want to draw to a vec. let mut strings = Vec::new(); let mut text = Text::default(); text.setstring("Hello world!"); text.color = color::WHITE; text.pos.y -= 50.0; text.push(string); // Assign the strings we want to draw to a batch. engine.textset(&screen, &strings); } let mut isactive = true; while isactive { // Input for closing the window. while let Some(message) = engine.inputpoll() { match message { InputMessage::CloseRequested => isactive = false, InputMessage::KeyPressed(key) => match key { KeyboardButton::Escape => isactive = false, _ => {}, }, _ => {}, } } // Commit any state we changed to the window. This will trigger a draw. engine.window_commit(); // This sleeps until it's ready for the next tick, ensuring the 144 TPS we set earlier. clock.tick(); } } ```