#pragma once #include #include "shaders.hpp" #include #include #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); };