Ethan's wrapper around SDL for easier use.
git clone https://github.com/cornellev/sdl-wrapper.git
cd sdl-wrapper
make demo
./demo
The demo code does a good job showing all the features.
Here's a step-by-step example.
After including gui/window.h
, you can create a window with
Window window("Window Name", WINDOW_WIDTH, WINDOW_HEIGHT);
Then, create a view that subclasses View
and attach it to the window.
MyView* my_view = new MyView();
window.attach_view(my_view);
From then on, the the window will manage the memory allocated for my_view
.
Finally, present the window, which is a blocking call.
window.present();
You can install the library to /usr/local
with sudo make install
, sudo make uninstall
, and sudo make reinstall
.
All header files are well documented.
Please read them for additional information.
For example, geo/midpoint.h
contains a circle-drawing primitive.
GUI
Geometry
Utilities