Files
escape-the-dawn/Escape-the-Dawn/Renderer.h
T
2014-03-11 14:46:43 +01:00

70 lines
1.3 KiB
C++

#ifndef Renderer_h__
#define Renderer_h__
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include "OpenGL.h"
#include <glm/glm.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
#include "glerror.h"
#include "Camera.h"
#include "ShaderProgram.h"
#include "Model.h"
class Renderer
{
public:
glm::mat4 viewMatrix;
glm::mat4 projectionMatrix;
int HEIGHT, WIDTH;
struct ModelData
{
std::shared_ptr<Model> model;
glm::mat4 ModelMatrix;
ModelData(std::shared_ptr<Model> _model, glm::mat4 _modelMatrix)
: model(_model), ModelMatrix(_modelMatrix) {}
};
std::vector<ModelData*> ModelsToRender;
Renderer();
void Initialize();
void Draw(double dt);
void DrawText();
void AddModelToDraw(std::shared_ptr<Model> model, glm::vec3 position, glm::quat orientation);
void AddTextToDraw();
void LoadContent();
GLFWwindow* GetWindow() const { return m_Window; }
std::shared_ptr<Camera> GetCamera() const { return m_Camera; }
private:
GLFWwindow* m_Window;
GLint m_glVersion[2];
GLchar* m_glVendor;
std::shared_ptr<Camera> m_Camera;
ShaderProgram m_ShaderProgram;
ShaderProgram m_ShaderProgramNormals;
void DrawModels();
};
#endif // Renderer_h__