Git Product home page Git Product logo

gfx-rs's Introduction

gfx-rs

Build Status Gitter Chat Stories in Ready

Documentation is hosted on rust-ci.

gfx-rs is a high-performance, bindless graphics API for the Rust programming language. It aims to be the default API for Rust graphics: for one-off applications, or higher level libraries or engines.

Why gfx-rs?

  • Graphics APIs are mostly designed with C and C++ in mind, and hence are dangerous and error prone, with little static safety guarantees.
  • Providing type safe wrappers around platform-specific APIs is feasible, but only pushes the problem of platform independence to a higher level of abstraction, often to the game or rendering engine.
  • Modern graphics APIs, whilst providing a great degree of flexibility and a high level of performance, often have a much higher barrier to entry than traditional fixed-function APIs.
  • Graphics APIs like OpenGL still require the developer to 'bind' and 'unbind' objects in order to perform operations on them. This results in a large amount of boiler plate code, and brings with it the usual problems associated with global state.

Goals

gfx-rs aims to be:

  • type-safe and memory-safe
  • compatible with Rust's concurrency model
  • highly performant with minimal latency
  • an abstraction over multiple graphics APIs: OpenGL, Direct3D, Mantle, etc.
  • orthogonal to context backends: GLFW, SDL2, gl-init-rs, etc.

Non-goals

gfx-rs is not:

  • a rendering engine
  • a game engine
  • bound to a specific maths library

gfx-rs will not handle:

  • window and input management
  • mathematics and transformations
  • lighting and shadows
  • visibility determination
  • draw call reordering
  • de-serializing of scene data formats
  • abstractions for platform-specific shaders
  • material abstractions

Getting started

Add the following to your Cargo.toml:

[dependencies.gfx]
git = "http://github.com/gfx-rs/gfx-rs"

See the triangle example for a typical context initialization with glfw, or glutin example for glutin.

Crate hierarchy

Dependency graph

Building the examples

To build the examples run cargo test. The executables will be in the target directory.

# Build all Examples
cargo test
# Run Cube Example
target/examples/cube

Note

gfx-rs is still in the early stages of development. Help is most appreciated.

If you are interested in helping out, you can contact the developers on Gitter. See contrib.md for contact information and contribution guidelines.

gfx-rs's People

Contributors

kvark avatar brendanzab avatar emberian avatar sectopod avatar csherratt avatar kimundi avatar hannobraun avatar lucidd avatar bvssvni avatar tomaka avatar mttr avatar mitchmindtree avatar kokakiwi avatar nicholasbishop avatar photex avatar serpis avatar mtsr avatar amaranth avatar qres avatar gaudecker avatar yuriks avatar tomjakubowski avatar nulldatamap avatar anthiste avatar maikklein avatar jahfer avatar flodiebold avatar milibopp avatar escalant3 avatar chase-c avatar

Stargazers

Daniel Ribeiro avatar Wellington Torrejais da Silva avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.