c 2b 2b drawing rectangle

Solutions on MaxInterview for c 2b 2b drawing rectangle by the best coders in the world

showing results for - "c 2b 2b drawing rectangle"
Clelia
26 May 2018
1draw_rect(float x, float y, float half_size_x, float half_size_y, u32 color) {
2	x *= rs.height * render_scale;
3	y *= rs.height * render_scale;
4	half_size_x *= rs.height * render_scale;
5	half_size_y *= rs.height * render_scale;
6	x += rs.width / 2.f;
7	y += rs.height / 2.f;
8	// Change to pixels
9	int x0 = x - half_size_x;
10	int x1 = x + half_size_x;
11	int y0 = y - half_size_y;
12	int y1 = y + half_size_y;
13	draw_rect_in_pixels(x0, y0, x1, y1, color);
14}