pixels/README.md

32 lines
1.8 KiB
Markdown
Raw Normal View History

2019-11-20 19:27:51 +11:00
[![Documentation](https://docs.rs/pixels/badge.svg)](https://docs.rs/pixels)
[![Build Status](https://travis-ci.org/parasyte/pixels.svg?branch=master)](https://travis-ci.org/parasyte/pixels)
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
2019-09-28 21:09:06 +10:00
![Pixels Logo](img/pixels.png)
2019-09-30 07:31:31 +10:00
A tiny hardware-accelerated pixel frame buffer. :crab:
2019-09-28 21:09:06 +10:00
## But why?
2019-10-16 12:43:01 +11:00
Rapidly prototype a simple 2D game, pixel-based animations, software renderers, or an emulator for your favorite platform. Then add shaders to simulate a CRT or just to spice it up with some nice VFX.
2019-09-28 21:09:06 +10:00
`pixels` is more than just a library to push pixels to a screen, but less than a full framework. You're in charge of managing a window environment, event loop, and input handling.
## Features
2019-10-16 12:43:01 +11:00
- Built on modern graphics APIs powered by [`wgpu`](https://crates.io/crates/wgpu): DirectX 12, Vulkan, Metal, OpenGL.
2019-10-14 12:35:47 +11:00
- Use your own custom shaders for special effects. (WIP)
2019-09-28 21:09:06 +10:00
- Hardware accelerated scaling on perfect pixel boundaries.
2019-10-14 12:35:47 +11:00
- Supports non-square pixel aspect ratios. (WIP)
## Examples
2019-11-07 17:37:16 +11:00
- [Conway's Game of Life](./examples/conway)
- [Minimal example with SDL2](./examples/minimal-sdl2)
- [Minimal example with `winit`](./examples/minimal-winit)
- [Pixel Invaders](./examples/invaders)
2019-09-28 21:09:06 +10:00
## Comparison with `minifb`
2019-10-07 19:17:36 +11:00
The [`minifb`](https://crates.io/crates/minifb) crate shares some similarities with `pixels`; it also allows rapid prototyping of 2D games and emulators. But it requires the use of its own window/GUI management, event loop, and input handling. One of the disadvantages with the `minifb` approach is the lack of hardware acceleration (except on macOS, which uses Metal but is not configurable). An advantage is that it relies on fewer dependencies.