Expand description

A Rust library for simple and straightforward drawing of graphics, similar to Processing.

All interaction with the library happens through an instance of Window.

Just like Processing, Pronto Graphics uses a hidden persistent state for drawing settings like colors, line thickness and font, which can be set at any point and will affect all later draw calls, either until the end of the frame, or until changed (See the individual documentation for details).

Prerequisites

Since Pronto Graphics uses SFML, specifically the SFML bindings for Rust, it’s prerequisites are the same as the SFML Rust bindings.

This might change in future versions.

Usage

Commonly you would have something like this in your fn main():

let mut pg = Window::new(800, 600, "Window Title");
// or
//let mut pg = Window::new_fullscreen();

loop {
    // --- Draw calls, etc. ---

    pg.update();
}

Thread safety

Pronto Graphics is not thread safe, both due to it’s own internal structure and the fact it uses SFML for drawing, which already isn’t thread safe. As long as you only use Pronto Graphics in your main thread however, it should be fine to have parallel non-graphics threads.

Structs

Mouse buttons.

A object representing a color in RGBA32 format. Red/Green/Blue/Alpha each range from 0 to 255.

Key codes known to SFML.

A texture object returned by Window::load_texture, that can be passed to Window::texture to draw the texture to the screen.

The core type of the Pronto Graphics library. All drawing and keyboard/mouse interaction happens through an instance of Window. It has to be updated every frame with Window::update for drawings to be rendered and the keyboard/mouse state to be updated.