-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (27 loc) · 936 Bytes
/
main.cpp
File metadata and controls
44 lines (27 loc) · 936 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
32
33
34
35
36
37
38
39
40
41
42
43
44
#define SDL_MAIN_USE_CALLBACKS 1
#define GLM_ENABLE_EXPERIMENTAL
#define OLAF_API
#include "beginner-api/camera-controllers/CamTPS.hpp"
#include "include/gan_callbacks.hpp"
#include "beginner-api/olaf-utilities/MultiObjectGeneration.hpp"
using namespace gan;
static std::vector<ShapeAPI> boxes;
int g_main(Book& book, int argc, char* argv[]) {
boxes.push_back(book.shapes.make<Box3D>(.5f, .5f, .5f));
auto grid = generateGrid(book.shapes, 20);
for (auto& g: grid) {
boxes.push_back(g);
}
boxes.insert(boxes.end(), grid.begin(), grid.end());
return 0;
}
int g_iterate(Book& book) {
for (auto& shape : boxes) {
book.render.draw3D(shape);
}
static CamTPS cam_controller(cam);
cam_controller.useKeyboard(book.keyboard, book.clock);
cam_controller.useMouse(book.mouse, book.clock);
book.window.setName(std::to_string(book.clock.time).c_str());
return 0;
}