Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.28 KB

README.md

File metadata and controls

55 lines (41 loc) · 1.28 KB

sdl-wrapper

Ethan's wrapper around SDL for easier use.

Demo

git clone https://github.com/cornellev/sdl-wrapper.git
cd sdl-wrapper
make demo
./demo

Usage

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.

Documentation

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