-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
40 lines (34 loc) · 940 Bytes
/
main.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
#include <iostream>
#include <graphics.h>
#include "include/Render.h"
#include "include/Ball.h"
using namespace std;
constexpr auto WINDOW_WIDTH = 640;
constexpr auto WINDOW_HEIGHT = 480;
int main() {
initgraph(WINDOW_WIDTH, WINDOW_HEIGHT);
BeginBatchDraw();
auto ball_ptr = new Ball(
WINDOW_WIDTH / 2,
WINDOW_HEIGHT / 2,
1.f,
1.f);
vector<RECT> block_list{
{-10, -10, 0, WINDOW_HEIGHT}, // 左墙壁
{0, -10, WINDOW_WIDTH + 10, 0}, // 上墙壁
{WINDOW_WIDTH, 0, WINDOW_WIDTH + 10, WINDOW_HEIGHT + 10}, // 右墙壁
{-10, WINDOW_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT + 10}, // 下墙壁
{100, 200, 130, 350},
{257, 104, WINDOW_WIDTH - 197, WINDOW_HEIGHT - 336},
{262, 255, WINDOW_WIDTH - 286, WINDOW_HEIGHT - 148},
{466, 316, WINDOW_WIDTH - 74, WINDOW_HEIGHT - 80},
};
while (true) {
cleardevice();
Render(ball_ptr, block_list);
FlushBatchDraw();
}
EndBatchDraw();
closegraph();
return 0;
}