-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderer.h
37 lines (34 loc) · 943 Bytes
/
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
#pragma once
#include "Mesh.h"
#include<vector>
#include<fstream>
#include<optional>
#include<GL/glew.h>
#include<glm/glm.hpp>
#include<Player.h>
#include<Skybox.h>
#include<Light.h>
class Renderer{
public:
Renderer();
void render();
void setModelMatrix(glm::mat4 model);
void setViewPrespective(glm::mat4 viewPrespective);
void setObserverPos(glm::vec3 pos);
void setHasTexture(bool hasTexture);
GLuint getShaderProgramID();
std::vector<Mesh> meshes;
std::vector<Light> lights;
Player player;
std::optional<Skybox> skybox;
bool shadeless=true;
private:
std::vector<Mesh*> transparentMeshes;
std::vector<Mesh*> solidMeshes;
void drawSkybox();
GLuint loadShaderProgram(const char* vertexShaderPath,const char* fragmentShaderPath);
void setShadeless(bool shadeless);
GLuint shaderProgramID;
GLuint modelLocation;
GLuint viewPrespectiveLocation,hasTextureLocation,observerLocation,shadelessLocation;
};