-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderer.h
74 lines (48 loc) · 1.38 KB
/
Renderer.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
#pragma once
#include <iostream>
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/string_cast.hpp>
#include <nanogui/nanogui.h>
#include "Shader.h"
#include "Camera.h"
#include "Object.h"
#include "Lighting.h"
#include "Bone_Animation.h"
class Renderer
{
public:
GLFWwindow* m_window;
static Camera* m_camera;
static Lighting* m_lightings;
static nanogui::Screen* m_nanogui_screen;
static Bone_Animation* m_bone_animation;
std::vector<Object> obj_list;
glm::vec4 background_color = glm::vec4(0.1,0.1,0.1,0.1);
bool is_scean_reset = true;
std::string model_name;
float delta_time = 0.0;
float last_frame = 0.0;
static bool keys[1024];
public:
Renderer();
~Renderer();
void nanogui_init(GLFWwindow* window);
void init();
void display(GLFWwindow* window);
void run();
void camera_move();
void load_models();
void draw_scene(Shader& shader);
void draw_object(Shader& shader, Object& object);
void draw_axis(Shader& shader, const glm::mat4 axis_obj_mat);
void draw_plane(Shader& shader);
void draw_bones(Shader& shader, Bone_Animation* m_bone_animation);
void bind_vaovbo(Object &cur_obj);
void setup_uniform_values(Shader& shader);
void scean_reset();
};