#include "raylib.h"; #include #include #include #define MAX_DEPTH 11 struct branch { Color color; uint8_t numOfBranches; float lenghthRatio; }; struct draw_args { Vector2 start; float angleDeg; float lenghth; int dep; }; class Tree { public: Tree(int size); ~Tree(); void Draw(Rectangle dest); void new_tree(); void generate_tree(); void draw_tree(draw_args first); void draw_branch(draw_args arg); Vector2 draw_line(Vector2 start, float angleDeg, float lenghth, int dep); private: int size = 0; RenderTexture2D target = {0}; Vector2 start = {0}; std::vector tree; std::list draw_calls; };