• Stars
    star
    4,605
  • Rank 9,217 (Top 0.2 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 10 years ago
  • Updated 6 months ago

Reviews

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

Repository Details

A modular game engine written in Rust

Piston

Build Status Crates.io Crates.io

A modular game engine written in Rust

Maintainers of Piston core libraries: @bvssvni

Dive into the world of Piston

Start new project with Piston

You should know how to build "hello world" with Rust, see http://www.rust-lang.org/.

Drawing a red rectangle

Add piston_window to your Cargo.toml, for example:

[dependencies]
piston_window = "*"

In "src/main.rs", type the following code:

extern crate piston_window;

use piston_window::*;

fn main() {
    let mut window: PistonWindow =
        WindowSettings::new("Hello Piston!", [640, 480])
        .exit_on_esc(true).build().unwrap();
    while let Some(event) = window.next() {
        window.draw_2d(&event, |context, graphics, _device| {
            clear([1.0; 4], graphics);
            rectangle([1.0, 0.0, 0.0, 1.0], // red
                      [0.0, 0.0, 100.0, 100.0],
                      context.transform,
                      graphics);
        });
    }
}

Use cargo run to start the application. It should clear the screen in white color and draw a red rectangle.

red-rectangle

Goals

The Piston project is a large collaboration among many developers. There are libraries for 2D, 3D, event programming, AI, image processing etc. By sharing the maintenance, we get more time to build new stuff.

Piston is as much a community project as it is a collection of libraries. Writing and maintaining code is expensive, and by sharing this cost we reach our goals faster. We believe that seeking personal goals and ambitions, while helping each other, results in higher quality.

  • Our main goal is to free up time for maintainers, and the people involved
  • ... such that we can create new amazing stuff and reach our personal goals
  • ... by making more people use Rust for game development and become engaged in open source

In addition, we do research or plan to in the following areas:

Dependency graph

dependencies

More Repositories

1

conrod

An easy-to-use, 2D GUI library written entirely in Rust.
Rust
3,347
star
2

hematite

A simple Minecraft written in Rust with the Piston game engine
Rust
1,847
star
3

dyon

A rusty dynamically typed scripting language
Rust
1,755
star
4

VisualRust

Visual Studio extension for Rust
C#
702
star
5

glfw-rs

GLFW3 bindings and idiomatic wrapper for Rust.
Rust
646
star
6

Piston-Tutorials

Tutorials for Piston
Rust
546
star
7

graphics

A library for 2D graphics, written in Rust, that works with multiple back-ends
Rust
479
star
8

piston-examples

A collection of examples using the Piston game engine
GLSL
342
star
9

rust-empty

A Makefile to get started with Rust (DEPRECATED)
Makefile
184
star
10

piston_window

The official Piston convenience window wrapper for the Piston game engine
Rust
155
star
11

hematite_server

A Minecraft server clone
Rust
140
star
12

turbine

A 3D game engine with built-in editor
Rust
140
star
13

resize

Simple resampling library in pure Rust
Rust
125
star
14

hematite_nbt

A full-featured Rust crate for working with Minecraft's Named Binary Tag (NBT) file format, including Serde support.
Rust
99
star
15

meta

A DSL parsing library for human readable text documents
Rust
90
star
16

freetype-rs

Rust bindings for FreeType library
Rust
85
star
17

vecmath

A simple and type agnostic Rust library for vector math designed for reexporting
Rust
79
star
18

ai_behavior

AI behavior tree
Rust
73
star
19

skeletal_animation

A Rust library for skeletal animation
Rust
62
star
20

texture_packer

📦 A library for texture packing
Rust
62
star
21

opengl_graphics

An OpenGL 2D back-end for the Piston game engine
Rust
60
star
22

sprite

A library for sprite hierarchy and scene management
Rust
57
star
23

gfx_graphics

A Gfx 2D back-end for the Piston game engine
Rust
55
star
24

music

A high level library for playing music and sound effects
Rust
40
star
25

eco

A tool for reasoning about breaking changes in Rust ecosystems
Rust
39
star
26

interpolation

A library for interpolation
Rust
34
star
27

wavefront_obj

A parser written in rust for the wavefront .obj file format.
Rust
27
star
28

freetype-sys

Low level bindings for the FreeType font library
Rust
27
star
29

glutin_window

A Piston window back-end using the Glutin library
Rust
25
star
30

piston_collada

Rust library for parsing COLLADA files
Rust
24
star
31

history_tree

A persistent history tree for undo/redo
Rust
24
star
32

sdl2_window

A SDL2 back-end for the Piston game engine
Rust
23
star
33

skeletal_animation_demo

Demo project for PistonDevelopers/skeletal_animation
Rust
22
star
34

gfx_text

Draw text for gfx using freetype
Rust
22
star
35

dev_menu

In-game developer menu for Piston and gfx-rs
Rust
17
star
36

glium_graphics

A Glium 2D back-end for the Piston game engine
Rust
17
star
37

fps_counter

A Frames Per Second counter
Rust
17
star
38

truetype

A library for reading fonts from the TrueType format
Rust
17
star
39

gfx_voxel

A voxel rendering library on top of Gfx
Rust
15
star
40

cam

A Rust library for 3D camera and navigation
Rust
15
star
41

current

A library for setting current values for stack scope, such as application structure
Rust
15
star
42

construct

A library for higher order functional programming with homotopy maps to construct 3D geometry
Rust
15
star
43

find_folder

A simple function for searching for a folder with a given name from the current working directory.
Rust
14
star
44

pluto

Game competition server software for Rust gamedev community
HTML
14
star
45

shaders

Shaders for game development in Rust
GLSL
14
star
46

quaternion

A simple and type agnostic Rust library for quaternion math designed for reexporting
Rust
13
star
47

mush

gui for dialogue graphs, et al.
Rust
12
star
48

hematite.piston.rs

The website for the Hematite project
CSS
10
star
49

asset_store

DEPRECATED - A unified method for easily reading and caching files over the filesystem and network.
Rust
10
star
50

dyon_asteroids

A demo game project for Dyon/Piston/Glium to test Dyon and research design for dyon_interactive
Rust
9
star
51

binaries

Pre-built binaries for external dependencies commonly used in Piston
9
star
52

docs

📄 Documentation for piston's projects.
8
star
53

physfs-rs

Rust bindings for PhysFS
Rust
8
star
54

graphics-lab

A place to visualize and test concepts related to Rust-Graphics
Rust
7
star
55

opengex

Meta rules for parsing the OpenGEX format
Rust
7
star
56

input

DEPRECATED - moved into the piston repo
Rust
7
star
57

texture

A library for texture conventions
Rust
7
star
58

gfx_debug_draw

Simple debug renderer (lines, text, etc) for gfx
Rust
7
star
59

glfw_window

A GLFW window back-end for the Piston game engine
Rust
7
star
60

wgpu_graphics

A WGPU 2D back-end for the Piston game engine
Rust
7
star
61

camera_controllers

A Rust library for controlling 3D cameras for the Piston engine
Rust
6
star
62

geometry

A structure for storing and look up 3D geometry
Rust
6
star
63

dual_quaternion

A simple and type agnostic Rust library for dual-quaternion math designed for reexporting
Rust
6
star
64

event_loop

DEPRECATED - moved into the piston repo
Rust
5
star
65

viewport

A library for storing viewport information
Rust
5
star
66

blog.piston.rs

The Piston Blog
HTML
5
star
67

dyon_to_rust

Dyon to Rust transpiler
Rust
5
star
68

dyon_snippets

A place to share Dyon source code and discuss library design
Rust
4
star
69

editor

Editor interface
Rust
4
star
70

project_r

DEPRECATED - Collaboration on an open source game to push Piston forward
4
star
71

winit_window

A winit back-end for pistoncore-window
Rust
4
star
72

quack

Quack - Duck typing traits
Rust
4
star
73

ddsfile

DirectDraw Surface (DDS) file format parsing and construction
Rust
4
star
74

button_tracker

A Piston library for tracking key/mouse press events from windows for use in update loops
Rust
4
star
75

read_color

A simple library for reading hex colors
Rust
4
star
76

atom-language-dyon

Dyon language support in Atom
CSS
4
star
77

dyon-tutorial

Tutorial for the Dyon programming language
HTML
3
star
78

button_controller

A Piston library for handling button state and events
Rust
3
star
79

graphics_tree

A 2D graphics backend for Piston-Graphics that stores and optimizes commands
Rust
2
star
80

float

Traits for generic floats in game development
Rust
2
star
81

array

Convenience methods for working with arrays
Rust
2
star
82

table

A table object type for dynamical data
Rust
2
star
83

read_token

A simple library to read tokens using look ahead
Rust
2
star
84

shapes

Convenience structs for 2D shapes
Rust
2
star
85

image_buffer

Provides a buffer type to ease the work with images and different color types.
Rust
2
star
86

drag_controller

A drag controller
Rust
2
star
87

range

A library for range addressing
Rust
2
star
88

vec

DEPRECATED - An experimental library using SIMD instructions for generic vector types
Rust
2
star
89

binpool

An experimental uniform binary format for particle physics analysis
Rust
2
star
90

scroll_controller

A Piston library for handling scrolling areas
Rust
1
star
91

timer_controller

A timer controller
Rust
1
star
92

split_controller

A Piston library for handling split layout state and events
Rust
1
star
93

lup

A custom indexed loop macro library for Rust.
Rust
1
star
94

deform_grid

A 2D deform grid for Piston-Graphics
Rust
1
star
95

select_color

A library for color selection
Rust
1
star
96

inventory

DEPRECATED - Plugin management for Rust programs
Rust
1
star
97

rect

Helper methods for computing simple rectangle layout
Rust
1
star
98

gfx_texture

A Gfx texture representation that works nicely with Piston libraries
Rust
1
star
99

underscore_args

Macro for underscore named argument syntax, aka Dyon
Rust
1
star
100

shader_version

A helper library for detecting and picking compatible shaders
Rust
1
star