#include #include #include #include "raylib.h" #define MAX_DEPTH 11 struct Branch { Color color; uint8_t numOfBranches; float lenghthRatio; }; struct DrawArgs { Vector2 start; float angleDeg; float lenghth; int dep; }; class Tree { public: Tree(int size); ~Tree(); void draw(Rectangle dest, float rotation); void newTree(); void deinit(); private: int size = 0; RenderTexture2D target = {0}; Vector2 start = {0}; std::vector branches; std::list draw_calls; void generateBranches(); void drawTree(); void drawBranch(); Vector2 drawLine(); };