forked from hiyorikotobuki/ComputerGraphics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrid.cpp
48 lines (36 loc) · 1.06 KB
/
grid.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
#include "screen.h"
#include "math.h"
int main(int argc, char* argv[])
{
G screen;
while(true)
{
for(int i = 1; i < 100; i+=1)
{
for(int j = 0; j < 640; j+=1 )
for(int k = 0; k < 480; k+=i)
screen.drawpixel(j,k);
for(int j = 0; j < 640; j+=i )
for(int k = 0; k < 480; k+=1)
screen.drawpixel(j,k);
screen.update();
screen.input();
screen.clearpixels();
SDL_Delay(20);
}
for(int i = 100; i > 1; i-=1)
{
for(int j = 0; j < 640; j+=1 )
for(int k = 0; k < 480; k+=i)
screen.drawpixel(j,k);
for(int j = 0; j < 640; j+=i )
for(int k = 0; k < 480; k+=1)
screen.drawpixel(j,k);
screen.update();
screen.input();
screen.clearpixels();
SDL_Delay(20);
}
}
return 0;
}