Chinchilib
A rust hommage to the Bunny Library designed for teaching the fundamentals of graphical programming, such as how to place a pixel and draw lines when given an array of memory that will rendered to screen.
It's mostly a wrapper arround pixels and winit that takes care of refresh rate, and keeps track of a set of pressed keys.
Usage
WinitHandler creates a window for you and manages events and timing. You can package your code into a chinchilib::GfxApp implementing struct such as MovingPixel in the example bellow.
WinitHandler will make calls to:
on_tickwhen its time for updating your state with the keys that are pressed right now (or have been pressed in between ticks), returntruewhen you wantdrawto be called afterwards;drawwhen its time to modify the framebuffer so that the image on screen changes;donewhen it wants to know if your app has anything left to do:NotDoneis self-explanatory,Remainmeans that your app is done, but you want the result to stay on screen until the user exits,Exitmeans that your app is done and the window should close.
WinitHandler closes the window when the user presses the close button or the escape key.
use Pixels;
use rgb;
use ;
/// Example app that only feature a pixel that moves.
const RED: RGBA8 = RGBA8 ;