piston

A modular game engine written in Rust

Github星跟踪图

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 = "0.98.0"

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

主要指标

概览
名称与所有者PistonDevelopers/piston
主编程语言Rust
编程语言Rust (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2014-04-24 09:18:05
推送于2024-05-21 23:30:18
最后一次提交2024-05-22 01:30:18
发布数3
最新版本名称V0.33.0 (发布于 )
第一版名称V0.5.0 (发布于 )
用户参与
星数4.7k
关注者数122
派生数235
提交数2k
已启用问题?
问题数890
打开的问题数36
拉请求数502
打开的拉请求数0
关闭的拉请求数14
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?