ysbaddaden / sdl.cr

SDL2 bindings for Crystal
102 stars 32 forks source link

Add optional bindings for SDL2_gfx #22

Open RomainFranceschini opened 6 years ago

RomainFranceschini commented 6 years ago

The SDL2_gfx library provides the basic drawing functions such as circles or triangles against renderers of SDL2.

This PR adds optional bindings for SDL2_gfx and closes #20. While the library provides support functions for other concerns (such as framerate control), only graphics related functions are binded in src/lib_gfx.cr.

src/gfx.cr defines 3 new shapes (Circle, Ellipse and Triangle) under SDL namespace and defines new drawing methods for SDL::Renderer.

I added the samples/gfx.cr example which showcase the new drawing methods.