blob: 157ceb38664ebfc2540eed764518e39d3a760bce (
plain)
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
|
#pragma once
#include <GL/glew.h>
#include "shaders.hpp"
#include <glm/glm.hpp>
#include <chrono>
#include "glm/gtc/matrix_transform.hpp"
using namespace std::chrono;
/**
* Bind this fonction with the following for debugging:
* glEnable ( GL_DEBUG_OUTPUT );
* glDebugMessageCallback( MessageCallback, 0 );
* @param source
* @param type
* @param id
* @param severity
* @param length
* @param message
* @param userParam
*/
void GLAPIENTRY MessageCallback( GLenum source,
GLenum type,
GLuint id,
GLenum severity,
GLsizei length,
const GLchar* message,
const void* userParam);
/**
* Main renderer class
*/
class Renderer {
private:
GLuint VAO;
GLuint RayMarchingShader;
GLuint UProjection;
GLuint UResolution;
GLuint UModel;
GLuint UTime;
glm::mat4 MProjection;
glm::mat4 MModel;
short Width,Height;
steady_clock::time_point ClockStart;
steady_clock::time_point ClockCurrent;
void LoadShader(std::string name);
public:
Renderer(short width,short height);
void Render();
void AjustViewport(short with,short height);
void UpdateShader(std::string name);
};
|