47 releases

✓ Uses Rust 2018 edition

0.4.6 Sep 1, 2019
0.4.1 Jul 28, 2019
0.1.17 Mar 31, 2019

#36 in GUI

Download history 109/week @ 2019-05-19 191/week @ 2019-05-26 95/week @ 2019-06-02 218/week @ 2019-06-09 80/week @ 2019-06-16 377/week @ 2019-06-23 390/week @ 2019-06-30 172/week @ 2019-07-07 6/week @ 2019-07-14 30/week @ 2019-07-21 66/week @ 2019-07-28 235/week @ 2019-08-04 65/week @ 2019-08-11 8/week @ 2019-08-18 881/week @ 2019-08-25

857 downloads per month

Apache-2.0

155KB
3K SLoC

rust-pushrod

Project Description

Build Status docs.rs for rust-pushrod

Cross Platform UI Widget Library for Rust that uses OpenGL as its rendering engine.

Draws inspiration from lots of GUI libraries.

If you like this library, please consider donating to this project!

(Ever Evolving) Screenshot of Sample

Horizontal Layout Sample

0.4.x Status

  • Fix build so that it builds on TravisCI for both OSes properly
  • New traits for optimization:
    • Drawable
    • InjectableSystemEvents
    • InjectableCustomEvents
  • Update Piston to the latest release
  • Fix hidden object traversal in main draw loop
  • Pass in event system trait so that Widgets have access to the Widgets from the WidgetStore
  • Add helper methods to access widgets by name and invalidate via Widget vector
  • Add Callbacks:
    • On Click without number of clicks
    • Mouse Moved
    • Widget Toggled
    • Timer Tick
    • Mouse Button Down
    • Mouse Button Up
    • Key Pressed
    • Add number of clicks to on click
    • Mouse Entered
    • Mouse Exited
  • Modify Event system so that it is a single trait
  • Get rid of Point and Size, use array value types instead
  • Fix all Widgets so that they draw to a texture
  • Fix Invalidation such that it walks the children so that drawing is done in order
  • Horizontal Layout sample application
  • Vertical Layout sample application
  • Update documentation
  • Widget offset updates (adding a child origin based on parent)
  • Optimizations to screen invalidation
  • Optimizations to drawing (every object is a 3D texture, not just blitting to a master texture)
  • Layout Manager optimizations (call do_update at the end of layout)
  • PageWidget: page controller to contain and swap displays of different pages of containers
  • GridLayoutContainer: layout objects equally sized in a grid
  • ToolboxWidget: layout that displays clickable images and captioned text
  • HorizontalSpaceWidget: horizontal spacer for layout containers
  • VerticalSpaceWidget: vertical spacer for layout containers
  • DropdownMenuWidget: displays a dropdown menu with selectable items in a list
  • SplitContainerWidget: splits two displays horizontally or vertically by a resizable spacer
  • GridWidget: displays a grid (either by lines or dots) evenly spaced by a grid snap offset
  • TabWidget: displays a series of tabs that can be used with the PageWidget to control page switching
  • PopupMenuWidget: displays a dropdown menu anywhere on the screen based on the mouse offset
  • Viewport: container that is larger than the screen that can be repositioned
  • SliderWidget: displays a slideable box in a bounding box, allowing for content to be scrolled
  • MenuBar: creates a menu bar at the top of the window that can be used to interact with the app
  • Layout for dialog boxes and/or form displays
  • Modal Alert box either by a new window or by a static modal dialog box that disables the top-level container
  • (De)serialization library for widgets to file
  • Modification of main application to use (de)serialization for layout

Please see here for more details on issues.

Philosophy

The reason I created this library instead of extending another library was that I wanted to keep these specific design ideas in mind:

  • Maintainable with little effort
  • Easily extensible
  • Lightweight enough to run on minimalist hardware
  • Easy to use and understand

These design ideas are critical. Keep it simple. Keep it stupid simple.

Prerequisites for Pushrod

Pushrod requires the following minimum versions:

Library Version
piston_window 0.89
piston2d-opengl_graphics 0.59
piston2d-graphics *
pistoncore-glfw_window 0.49
gl *

Optimization Note

To see what the CPU usage looked like before and after switching between 2D and 3D rendering engines, here is before, and this is after. These numbers represent the current version (0.3.x) before any rendering optimizations have been added.

So, is it worth it to add OpenGL? I'll let you decide.

Runnable Examples

Pre-Requisite for Mac OS X

You should use brew on your system. If you have Homebrew already installed, use brew install glfw to install the GLFW formula.

After installing pre-requisites:

cargo run --example simple

This will run the simple application demo. It's interactive, so have fun!

Dependencies

~5.5MB
~108K SLoC