-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.h
More file actions
66 lines (45 loc) · 1.46 KB
/
Application.h
File metadata and controls
66 lines (45 loc) · 1.46 KB
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
#ifndef LEARNINGOPENGL_APPLICATION_H
#define LEARNINGOPENGL_APPLICATION_H
#include <vector>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include "Camera.h"
#include "Mesh.h"
#include "Shader.h"
class Application {
public:
static bool setup();
static void finalize();
Application();
bool initialize();
void run();
private:
static void handleLibraryError(int code, const char *message);
static void resizeWindowFramebuffer([[maybe_unused]] GLFWwindow *window, int width, int height);
static void handleKeyEvent(GLFWwindow *window, int key, [[maybe_unused]] int scanCode, int action,
[[maybe_unused]] int modifiers);
static void handleMouseEvent(GLFWwindow *window, double xPosition, double yPosition);
static void handleMouseScrollEvent(GLFWwindow *window, [[maybe_unused]] double xOffset, double yOffset);
void setIcon() const;
void setupCallbacks() const;
bool setupRendering();
void render();
void dispose();
static bool isSetupComplete;
Camera camera;
Mesh cube;
Mesh octahedron;
Shader shader;
std::vector<glm::vec3> meshPositions;
std::vector<glm::vec3> meshRotations;
glm::vec3 cameraInputAxes;
glm::vec3 inputAxes;
glm::vec2 lastMousePosition;
glm::vec2 mouseOffset;
unsigned int selectedMesh;
float lastFrameTime;
float deltaTime;
GLFWwindow *window;
};
#endif //LEARNINGOPENGL_APPLICATION_H