-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
71 lines (61 loc) · 1.23 KB
/
Main.cpp
File metadata and controls
71 lines (61 loc) · 1.23 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "GraphicsLib.h"
#include <string>
//
// Example 1 - Hello World
//
// Draws a single pixel to the middle of the screen.
//
using namespace std;
struct circle {
int x, y, radius;
Color c;
bool filled;
circle(int _x, int _y, int _radius, Color _c, bool _filled) {
x = _x;
y = _y;
radius = _radius;
c = _c;
filled = _filled;
}
};
struct identifier
{
string s;
int x, y, font_size;
Color c;
identifier(int _x, int _y, int _font_size, Color _c, string _s) {
s = _s;
x = _x;
y = _y;
c = _c;
font_size = _font_size;
}
};
struct Node {
circle c;
identifier i;
Node(int _x, int _y, int _radius, string _msg, Color _c) {
c = circle(_x, _y, _radius, _c, false);
i = identifier(_x, _y, _radius / 10, White, _msg);
}
};
void drawCircle(circle c) {
DrawCircle(c.x, c.y, c.radius, c.c, c.filled);
}
void drawIdentifier(identifier i) {
DrawGDIString(i.x, i.y, i.font_size, i.c, i.s);
}
void drawNode(Node n) {
drawCircle(n.c);
drawIdentifier(n.i);
}
void main() {
UseAntiAliasing(true);
circle c = circle(800, 600, 100, Blue, false);
drawCircle(c);
identifier i = identifier(400, 400, 20, White, "hello");
drawIdentifier(i);
Node n
DrawGDIString(100, 100, 20, Blue, "hello");
SetPixel(80, 60, Yellow);
}