Polystrip is a 2D hardware-accelerated rendering library, primarily targeted at game development, but which could
probably be used in other applications as well. Polystrip intends to be a pure-rust replacement for the sdl2
crate.
This crate should not be considered stable until the 1.0 release. Following true semver spec, this crate will ~~likely~~ definitely make breaking changes between development versions. The 1.0 release will come when I think this crate is fully-featured.
This example makes a window, a renderer, and only the boilerplate necessary to correctly interface with with polystrip.
```rs let eventloop = winit::eventloop::EventLoop::new(); let window = winit::window::Window::new(&event_loop).unwrap();
let windowsize = window.innersize().tological(window.scalefactor()); let mut renderer = Renderer::new(&window, (windowsize.width, windowsize.height));
eventloop.run(move |event, _, controlflow| { match event { Event::WindowEvent { event: WindowEvent::Resized(newsize), .. } => { let windowsize = newsize.tological(window.scalefactor()); renderer.resize((windowsize.width, windowsize.height)); }, Event::MainEventsCleared => { let mut frame = renderer.getnext_frame(); // Render in here }, _ => {} } }); ```
More examples can be found in the examples directory, and can be run with cargo run --example <name>
.