qmetrics.net

pixels

GPU-accelerated 2D pixel frame buffer crate

pixels screenshot

pixels is a Rust library for a GPU-backed 2D pixel buffer with fixed resolution, aimed at simple games, emulators, and software renderers. You supply windowing and input; it handles scaling and optional shaders via wgpu.

Overview

pixels exposes a Pixels type that holds an explicit-width, height pixel buffer rendered on the GPU through wgpu, which the crate re-exports. It fits rapid prototyping of 2D games, pixel animations, emulators, and software renderers where you already manage a window, event loop, and input through frameworks such as winit.

Hardware-accelerated scaling can snap to perfect pixel boundaries, and you can attach custom WGSL shaders for effects such as CRT simulation. A default ScalingRenderer scales the framebuffer to the window. Environment variables documented alongside wgpu examples let you pick graphics backend, adapter name, or low versus high power GPU preference.

The library sits between a minimal framebuffer crate and a full game engine: it does not own GUI or input, but adds GPU presentation and shader hooks compared with software-only buffers. Examples in the project cover minimal winit integration, Dear ImGui, egui, WebGL2, and software raster bridges such as tiny-skia or raqote.

Compared with minifb, pixels keeps your choice of windowing and uses GPU acceleration broadly rather than software rasterization alone. DirectX 11, WebGL2, and WebGPU paths are noted as evolving in project documentation.

Key features

  • GPU-backed pixel buffer
  • wgpu graphics pipeline
  • Custom shader effects
  • Perfect-pixel scaling mode
  • ScalingRenderer for windows
  • raw-window-handle compatibility
  • GPU adapter selection env vars
  • Non-square pixel aspect (WIP)

Use cases

  • 2D game and emulator prototypes
  • Pixel-perfect scaled framebuffer
  • Software renderer with GPU output
  • Shader post-processing on pixels

Tags

Similar software

Bevy Engine

Rust game engine with ECS architecture

Bevy Engine is a data-driven Rust game engine for 2D and 3D work. It emphasizes modularity, parallel execution, and fast iteration while the project remains under active development.

★ 50k⟳ yesterdayApache-2.0
Open Source Alternative to:Unity

Phaser

HTML5 2D game framework with Canvas and WebGL

Phaser is a JavaScript and TypeScript framework for browser games on desktop and mobile, with scene APIs, physics, animations, and loaders. Games can target embed platforms or wrap for native stores via third-party tooling

★ 40.8k⟳ 3 months agoMIT

raylib

Minimal C library for games and graphical programs

raylib is a C99 graphics and game programming library with no mandatory external dependencies. It suits prototypes, tools, education, and embedded targets across desktop, mobile, and web.

★ 35.8k⟳ todayZlib
Frameworks & PlatformsDesktop/CLI app

Matter.js

JavaScript two-dimensional rigid body physics engine

Matter.js simulates 2D rigid-body physics for browser games and interactive pages. It runs in modern browsers and Node.js with canvas rendering and touch-friendly controls.

★ 18.7k⟳ 1 month agoMIT
Frameworks & PlatformsDesktop/CLI app

wgpu

Cross-platform safe Rust graphics API

wgpu implements the WebGPU-style API in Rust for native and WebAssembly targets. It backs Firefox, Servo, and Deno WebGPU integration and maps to Vulkan, Metal, D3D12, and GLES.

★ 18.7k⟳ todayApache-2.0
Frameworks & PlatformsDesktop/CLI app

GLFW

Cross-platform windowing library for OpenGL and Vulkan

GLFW is a C library that creates windows, graphics contexts, and surfaces while handling input and events. It targets OpenGL, OpenGL ES, and Vulkan on desktop and Unix-like systems.

★ 15.5k⟳ 3 months agoZlib
Frameworks & PlatformsDesktop/CLI app