Yet Another Drawing Library
- Quick prototyping (images, animations)
- Embedded devices (pure cpu rendering, no gpu required)
- Simple to use
- Alpha blending
- Simple shapes (lines, rectangles, circles, triangles)
- Text rendering and font loading
- Loading, saving images
- Animations and export to gif
- Antialiased circles and lines
- Graphical effects (blur, grayscale, invert)
- Image resizing
- and other useful stuff
- Multithreading
- see classic examples, for examples that generate images, and sdl examples for live examples that use sdl2.
(example above uses 2 triangles and texture mapping, also logo was resized to 250x250, so it looks a bit squished. See texture_mapping_example.cpp
$ mkdir build && cd build
$ cmake ..
$ make -j
#include <yadl/yadl.hpp>
int main(int argc, char const *argv[])
{
using namespace yadl;
Canvas canvas(500, 500);
canvas.Clear(Color::Dark);
Context ctx(canvas);
ctx.SetColor(Color::Red).SetPosition(canvas.GetCenterX(), canvas.GetCenterY());
int radius = 150;
shape::DrawFilledCircleAA(ctx, radius); // AA stands for antialiased
io::SaveAsPNG("circle.png", canvas);
return 0;
}
This code can be found in circle_example.cpp
- FreeType (2.13+)
- libpng
- SDL2 (2.0.18+) for sdl examples
- GLM for cube example
- stb_image
- stb_image_write
- gif-h
- imgui (for sdl examples)
- tinyobjloader
- Cat photo (Public Domain), resized to 25% and converted to png.
- Font Roboto Condensed
- C++ logo (Public Domain) resized to 250x250px
- Box texture
- Wet Floor Sign model