-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (29 loc) · 779 Bytes
/
Copy pathmain.cpp
File metadata and controls
31 lines (29 loc) · 779 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
#include "snow.h"
int main() {
HDC desktop = GetDC(NULL);
int screenX = GetSystemMetrics(SM_CXSCREEN);
int screenY = GetSystemMetrics(SM_CYSCREEN);
double chance = 0.2;
snowflake snowflakesI[3000];
int distance[3000][2];
int gX, gY;
//Init snowflakes
for (int i = 0; i < 1500; i++) {
gX = rand() % screenX;
gY = rand() % screenY;
if (allCheckDist(gX, gY, i * 2 - 1, distance)) {
snowflakesI[i].init(gX, gY, screenX, screenY, desktop, 0xFFFFFF, 0);
distance[i][0] = gX;
distance[i][1] = gY;
}
else {
i--;
}
}
//Draw snowflakes
while(true) {
for (int i = 0; i < 1500; i++) {
snowflakesI[i].draw();
}
}
}