Giter Site home page Giter Site logo

gust's Introduction

Gust

โš ๏ธ This project is no longer maintained, if you are interested by working with it contact me, I will try to update it.

Gust is a graphical library written in pure Rust from simple openGl binding and freetype-rs library. The purpose of Gust is to help me to understand simple computer graphic system (2D) and to let me handle the complexe language that is Rust.

Philosophy

The philosophy behind Gust is to make a simple, elegant, safe and reliable graphic library in Rust. The key concepts and limitations are:

Wrap OpenGl: Make it more simple to use and more rusty.

use gust::prelude::*;

let window = Window::new(1920, 1080, "Hello World !");
let player_texture = Rc::new(Texture::from_path("assets/player.png"));
let mut player_sprite = Sprite::from(&player_texture);
let event_handler = EventHandler::new(&window);

player_sprite.set_position(Vector::new(1920. / 2., 1080. / 2.));

while window.is_open() {

    for event in event_handler.fetch() {
        match event.1 {
            Events::Key(Key::Escape, _, Action::Press, _) => { window.should_close() },
            _ => { /* Nothing happen */ }
        }
    }

    window.clear();
    window.draw(player_sprite);
    window.display();
}
println!("GoodBye !");

This simple code permit to create a window and draw on it until the user press escape key.

No specific concept

There is no animations modules, no advanced event system, no multi-threaded rendering.

(All of this will be implemented inside Rame which is another project based on this one)

The idea is that you can create this with Gust. It's not Gust job to provide you that kind of Api.

Learning

It's my project and the idea behind it it's to learn as much as I can. So if something seems cool to implement I will probably do it.

Example

I will preach Rust, so I have to show people the better rust code possible. Is acced to good programming practice and flow. (Nice git usage, documentation, unit test, bench-mark, beautiful and reliable) It is some sort of example for my peoples.

What's inside Gust

Here you can see the UML Diagram.

Uml Gust

And you can generate the doc by writing:

cargo doc --open

and hitting ther Enter Key of your keyboard

I Swear !

How to contribute

You are welcome if you want to put your code into Gust, However you will have to make a proper pull-request get reviewed. You should know that but it's important to understand that I want the best code possible, even if mine is not. I started rust only 6 month ago now. You're allowed to pull-request your own concept if it follow the Philosophy and to correct or optimize my code.

Disclaimer

You should not use Gust right now or if you do it let all bug that you encounter into issues and why not think about fix them :D.

Thank you and you can read the Wiki if you are interested or look at my other projects.

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.