CanvasLib is a tiny c++ GLFW 2d graphics library for fast prototyping of some simulations/games/whatever. Inspired by JS canvas.
#include <CanvasLib/CanvasLib.hpp>
auto main() -> int
{
canv::Canvas canvas{ 1000, 800 };
canvas.setUpdateFunction(
[&canvas](double fpsScale)
{
canvas.setFillColor(canv::Colors::green);
canvas.drawRectangle(100, 100, 50, 150);
});
canvas.start();
}
The only dependency is glfw
library. You can install it via your favorite package manager. For exmple:
sudo apt-get install libglfw3 libglfw3-dev
Or use Nix flakes.
include(FetchContent)
FetchContent_Declare(CanvasLib
GIT_REPOSITORY "https://github.com/Lolitron-0/CanvasLib"
GIT_TAG "origin/master"
)
FetchContent_MakeAvailable(CanvasLib)
target_link_libraries(foobarbaz PUBLIC CanvasLib)
Doxygen documentation is available here.