forked from ntxtung/SnakeVer2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDevelop.cpp
71 lines (59 loc) · 1.13 KB
/
Develop.cpp
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 <iostream>
#include "Declaration.h"
#include "GraphicAPI.h"
using namespace std;
void showCross(bool isOn)
{
if (isOn==true)
{
setcolor(BLUE);
line(0,0,W,H);
line(W,0,0,H);
setcolor(DEFAULT_COLOR);
}
}
void showGrid(bool isOn)
{
if (isOn==true)
{
setcolor(RED);
for (int i=0; i<=W; i+=unitLength)
line(i,0,i,H);
for (int i=0; i<=H; i+=unitLength)
line(0,i,W,i);
setcolor(DEFAULT_COLOR);
}
}
void showInfo(bool isOn)
{
if (isOn==true)
{
cout << "IU Snake version " << endl;
cout << "Resolution: " << W << " x " << H << endl;
cout << "Unit length: " << unitLength << "(pixel)" << endl;
}
}
void gradientTest(bool isOn)
{
if (isOn==true)
{
int b=0;
int g=0;
for (int i=0; i<=W; i+=W/255)
{
for (int j=0; j<=H; j+=H/255)
{
putpixel(i,j,RGB(i,g,b));
g++;
}
b++;
}
}
}
void develop()
{
showInfo(1);
showGrid(1);
showCross(1);
gradientTest(1);
}