• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PistonDevelopers/piston: A modular game engine written in Rust

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

PistonDevelopers/piston

开源软件地址:

https://github.com/PistonDevelopers/piston

开源编程语言:

Rust 99.9%

开源软件介绍:

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap