#pragma once

#include "render.h"
#include <color.h>

namespace render{
namespace primitives2d{

void init();
void free();

void flush();

using color::rgba;

extern rgba pointColor, lineColor, fillColor;

// �����
void point(const vec2f&, const rgba& = color::white, float size = 1.0f);

// �����
void line(const vec2f&, const vec2f&, const rgba& = lineColor);
inline void line(const vec2f&, const vec2f&, const rgba&, const rgba&);

// �����������
void triangle(const vec2f&, const vec2f&, const vec2f&, // x/y
              const rgba&, const rgba&, const rgba&); // color

void triangle(const vec2f&, const vec2f&, const vec2f&, const rgba& = color::white);

//�������
void quad(const vec2f& pos, const vec2f& size, const rgba& = color::white);

//���� �� �������������
void circle(const vec2f& pos, const vec2f &radius, const rgba& = color::white, float angle = 0, uint32_t edges = 0);

//���������� �� �����
void round(const vec2f& pos, float radius, const rgba& = color::white, float angle = 0, uint32_t edges = 0);

//������� �� �����
void rect(const vec2f&, const vec2f&, const rgba& = color::white);

//������
void curve(uint32_t size, const vec2f *data, const rgba& = color::white, float quality = 1);

//����
void ark(const vec2f& pos, float radius, float angle, float value, const rgba& = color::white, uint32_t quality = 0);
void arkSolid(const vec2f& pos, float radius, float angle, float value, const rgba& = color::white, uint32_t quality = 0);
void arkBorder(const vec2f& pos, float radius, float angle, float value, const rgba& = color::white, uint32_t quality = 0);

//������
void ring(const vec2f &pos, float radius, float radius2, const rgba& = color::white, float angle = 0, uint32_t quality = 0);
void ringBorder(const vec2f &pos, float radius, float radius2, const rgba& = color::white, float angle = 0, uint32_t quality = 0);

//������-���� �_�
void ringArk(const vec2f &pos, float radius, float radius2, float angle, float value, const rgba& = color::white, uint32_t quality = 0);
void ringArkBorder(const vec2f &pos, float radius, float radius2, float angle, float value, const rgba& = color::white, uint32_t quality = 0);
void ringArkRadius(const vec2f &pos, vec2f radiusPair1, vec2f radiusPair2, float angle, float value, const rgba& = color::white, uint32_t quality = 0);

void polygone(const vec2f *vertices, uint32_t count, const rgba &color, bool ccwOrder = false);

}

}
