void render::rounded_rect(int x, int y, int w, int h, int Radius, color color)
{
vertex_t Round[64];
for (int i = 0; i < 4; i++) {
int _x = x + ((i < 2) ? (w - 4) : 4);
int _y = y + ((i % 3) ? (h - 4) : 4);
float a = 90.f * i;
for (int j = 0; j < 16; j++) {
float _a = DEG2RAD(a + j * 6.f);
Round[(i * 16) + j] = vertex_t(vec2_t(_x + Radius * sin(_a), _y - Radius * cos(_a)));
}
}
render::draw_textured_polygon(64, Round, color);
interfaces::surface->draw_polygon(64, Round);
}