• Stars
    star
    1,779
  • Rank 26,163 (Top 0.6 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 5 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tiny hardware-accelerated pixel frame buffer. ๐Ÿฆ€

Crates.io Documentation GitHub actions GitHub activity GitHub Sponsors

Pixels Logo

A tiny hardware-accelerated pixel frame buffer. ๐Ÿฆ€

But why?

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.

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.

MSRV Policy

The Minimum Supported Rust Version for pixels will always be made available in the MSRV.md file on GitHub.

Features

  • Built on modern graphics APIs powered by wgpu: Vulkan, Metal, DirectX 12, OpenGL ES3.
    • DirectX 11, WebGL2, and WebGPU support are a work in progress.
  • Use your own custom shaders for special effects.
  • Hardware accelerated scaling on perfect pixel boundaries.
  • Supports non-square pixel aspect ratios. (WIP)

Examples

Games ๐ŸŽฎ

Demos ๐Ÿงช

Troubleshooting

Driver issues

The most common issue is having an outdated graphics driver installed on the host machine. pixels requests a low power (aka integrated) GPU by default. If the examples are not working for any reason, you may try setting the WGPU_POWER_PREF=high environment variable to see if that addresses the issue on your host machine.

You should also try to keep your graphics drivers up-to-date, especially if you have an old Intel integrated GPU. Keep in mind that some drivers and GPUs are EOL and will not be supported.

Logging

You may want to use the RUST_LOG environment variable (see env_logger for full documentation) to gain additional insight while troubleshooting the examples. RUST_LOG=trace will spew all logs to stderr on debug builds:

$ RUST_LOG=trace cargo run --package minimal-winit

And also on release builds when default features are disabled:

$ RUST_LOG=trace cargo run --package minimal-winit --release --no-default-features

Comparison with minifb

The 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.

Comparison with softbuffer

There is a more recent project called softbuffer. It provides similar capabilities to what pixels offers, but is intentionally limited to software-only (not hardware-accelerated) rasterization.

More Repositories

1

onlyerror

Obsessively tiny error derive macro
Rust
84
star
2

alt64

Alternate Everdrive64 Menu. Original release from: http://krikzz.com/forum/index.php?topic=816.0
C
68
star
3

myn

Minimalist Rust syntax parsing for procedural macros
Rust
62
star
4

node-capstone

Node.js bindings for the Capstone disassembler library. https://parasyte.github.io/node-capstone-docs
JavaScript
58
star
5

cartunes

Simple comparison app for iRacing car setups.
Rust
55
star
6

egui-tokio-example

Example showing how to use tokio and egui together.
Rust
41
star
7

n64rd

Nintendo 64 Remote Debugger
C
34
star
8

sonant-rs

A Rust port of the Sonant 4K synth with streaming support.
Rust
28
star
9

aa

Alcoholic Astronomers
Rust
23
star
10

onlyargs

Only argument parsing! Nothing more.
Rust
13
star
11

asm6

A small fork of Loopy's excellent 6502 assembler
C
12
star
12

jay-extend

A super fast prototypal inheritance microlib
JavaScript
11
star
13

pn-candybox

Candy Box with Real-Time statistics
JavaScript
9
star
14

picard

PIC Action Replay Decoder
Rust
9
star
15

error-iter

Error::sources on stable Rust
Rust
7
star
16

libmad-n64

libmad with MIPS patches. Originally from: http://hkzlab.spatof.org/files/misc/n64_toolchain_howto/
C
7
star
17

melonJS-pubnub

Lightweight multiplayer gaming with melonJS and PubNub
JavaScript
6
star
18

snesrc

Super Nintendo Entertainment System Re-Compiler
C
5
star
19

kwcpu

An unobtrusive CPU meter that fits in the default Windows 11 taskbar. Supports up to 32 cores.
Python
4
star
20

edgescan

A basic VCD viewer GUI for macOS, Windows, and Linux
Rust
3
star
21

libmikmod-n64

libmikmod for Nintendo 64. Originally from: http://www.dragonminded.com/n64dev/
C
3
star
22

whispers-futures

Telephonic Whispers in Rust with Futures 0.3. See: http://thornydev.blogspot.com/2014/01/chinese-whispers-in-rust.html
Rust
3
star
23

batman

Enable floating point exceptions with backtraces.
Rust
3
star
24

GlitchBob-LPC

Voltage glitching automation tool to break protection on NXP LPC microcontrollers.
3
star
25

task-webapp

Stop Web App Bloat!
CSS
3
star
26

circuitous

Collaborative high-level digital circuit editor.
JavaScript
2
star
27

sublime-syntax-customasm

Sublime Text 4 syntax highlighting support for customasm
2
star
28

bmod

BakkesModSDK for Rust
Rust
2
star
29

grunt-glsl-optimizer

Optimize your GLSL shaders!
JavaScript
2
star
30

stoat

A tiny, energetic game engine. Loves to do the weasel war dance.
JavaScript
1
star
31

steeve-sync

Synchronize your Deep Rock Galactic saves between the Xbox and Steam editions.
Rust
1
star
32

syno-scripts

Scripts for Synology Disk Station Manager
Perl
1
star