-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo3.c
More file actions
45 lines (37 loc) · 879 Bytes
/
demo3.c
File metadata and controls
45 lines (37 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "types.h"
#include "user.h"
#include "graphics.h"
// mode 13 with batching
int main() {
drawbegin(MODE_13);
for (int i = 0; i < 20; i++) {
drawline(0, 10 * i, 319, 199 - (10 * i), i + 1);
}
fillrect(100, 140, 112, 50, 5);
fillrect(200, 60, 50, 100, 4);
fillrect(50, 20, 100, 50, 7);
fillrect(100, 40, 20, 50, 1);
drawcircle(100, 140, 20, 3);
drawcircle(260, 120, 40, 5);
drawcircle(40, 40, 100, 2);
int polygon[] = {
40,80,
9,95,
1,129,
23,156,
57,156,
79,129,
71,95
};
int polygon2[] = {
236,103,
195,120,
161,90,
181,155,
227,149,
};
drawpolygon(polygon, sizeof(polygon) / (sizeof(int) * 2), 5);
fillpolygon(polygon2, sizeof(polygon2) / (sizeof(int) * 2), 6);
drawend();
exit();
}