This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.h
76 lines (60 loc) · 1.46 KB
/
app.h
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
72
73
74
75
76
#ifndef HINAPE_APP_H
#define HINAPE_APP_H
#include <SDL.h>
#include <map>
#include <string>
#include "gui/manager.h"
#include "lib/mathlib.h"
#include "util/camera.h"
#include "scene/scene.h"
#include "scene/undo.h"
#include "physics-system-api.h"
class Platform;
struct Launch_Settings
{
std::string scene_file;
std::string env_map_file;
bool headless = false;
// If headless is true, use all of these
std::string output_file = "out.png";
int w = 640;
int h = 360;
int s = 256;
int d = 8;
bool animate = false;
float exp = 1.0f;
bool w_from_ar = false;
bool no_bvh = false;
};
class App
{
public:
explicit App(const Launch_Settings &set, Platform *plt = nullptr);
~App();
void render();
auto quit() -> bool;
void event(SDL_Event e);
// HinaPE 1.1.2
void register_physics_API(const std::shared_ptr<HinaPE::PhysicsSystemAPI> &);
private:
void apply_window_dim(Vec2 new_dim);
auto screen_to_world(Vec2 mouse) -> Vec3;
// Camera data
enum class Camera_Control
{
none, orbit, move
};
Vec2 window_dim, mouse_press;
bool selection_changed = false;
Camera_Control cam_mode = Camera_Control::none;
Camera camera;
Mat4 view, proj, iviewproj;
// Systems
Platform *plt = nullptr;
Scene scene;
Gui::Manager gui;
Undo undo;
std::shared_ptr<HinaPE::PhysicsSystemAPI> _physics_system_api = nullptr;
bool gui_capture = false;
};
#endif