2D graphics library for OpenGL, designed to support various shapes, lighting, GUI elements, collisions, and particle effects.
- Shapes: Draw lines, rectangles, and sprite.
- Lighting: Illuminate your scenes with customizable lighting effects.
- GUI: Easily integrate graphical user interfaces into your applications.
- Collisions Simple collisions Circle<->Circle, Rectangle<->Circle (no rotation for rectangles)
- Limited shapes for collisions
- The library is still in development, bugs and missing features to be expected
Requires c++20
- Clone the repository:
git clone https://github.com/6413/fan.git
- Using Visual Studio use fan.sln. Alternatively compile using clang++/g++ using make_imgui, make_pch, make, in order
- Install required dependencies libx11-dev, libxrandr-dev, libwebp-dev, libxcursor-dev, llvm, clang/gcc, libopus-dev, OpenGL, GLFW
sudo apt install clang -y &&
sudo apt install make -y &&
sudo apt install libwebp-dev -y &&
sudo apt install llvm -y &&
sudo apt install clang -y &&
sudo apt install libfmt-dev -y &&
sudo apt install libglfw3-dev -y &&
sudo apt install libopus-dev -y &&
sudo apt install libx11-dev -y
- Clone the repository:
git clone https://github.com/6413/fan.git
- Setup and compile using
make -B -f make_imgui
,make -f make_pch
,make
, in order
Main file can be controlled by MAIN
-make variable for example make MAIN=examples/graphics/2D/shapes/rectangle.cpp
Using the library from outside the project, change ROOT_PATH in Makefiles
- Hello world rectangle
#include fan_pch int main() { loco_t loco; fan::graphics::rectangle_t rect{{ .position = 400, .size = 200, .color = fan::colors::red }}; loco.loop([&] { }); }
Check out the examples directory for sample projects demonstrating various features of the library.
Developer console support (F3)
This project is licensed under the MIT License - see the LICENSE file for details.