-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window.h
81 lines (64 loc) · 1.92 KB
/
Window.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
77
78
79
80
81
#ifndef _WINDOW_H_
#define _WINDOW_H_
#include <chrono>
#include "main.h"
#include "Cube.h"
#include "shader.h"
#include "Camera.h"
#include "ParticleSystem.h"
////////////////////////////////////////////////////////////////////////////////
class Window
{
public:
// Window Properties
static int width;
static int height;
static const char* windowTitle;
static GLFWwindow* window;
static bool culling;
// time controls
static std::chrono::high_resolution_clock::time_point start;
static std::chrono::steady_clock::time_point currTime;
static bool started;
static bool paused;
static int numIncr;
// Imgui display dimensions
static ImVec2 imguiMin;
static ImVec2 imguiMax;
// Objects
static ParticleSystem* ps;
static Cube* ground;
// Physics constants
static glm::vec3 gravity;
static float density;
static float drag;
static float mass;
static float groundLevel;
static float restitution;
static float friction;
// Shader Program
static GLuint shaderProgram;
// Act as Constructors and desctructors
static bool initializeProgram();
static bool initializeObjects();
static void cleanUp();
// for the Window
static GLFWwindow* createWindow(int width, int height);
static void resizeCallback(GLFWwindow* window, int width, int height);
// GUI helpers
static void updateImguiPos();
static void drawImgui();
static bool initGui;
// update and draw functions
static void idleCallback();
static void displayCallback(GLFWwindow*);
// helper to reset the camera
static void resetCamera();
// callbacks - for interaction
static void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
static void mouse_callback(GLFWwindow* window, int button, int action, int mods);
static void cursor_callback(GLFWwindow* window, double currX, double currY);
typedef std::chrono::duration<float> fsec;
};
////////////////////////////////////////////////////////////////////////////////
#endif