2013-07-02 09:53:23 +02:00
|
|
|
#ifndef _GTARENDERER_HPP_
|
|
|
|
#define _GTARENDERER_HPP_
|
2013-07-03 10:46:07 +02:00
|
|
|
|
|
|
|
#define GLEW_STATIC
|
|
|
|
#include <GL/glew.h>
|
2013-07-04 03:40:47 +02:00
|
|
|
#include <memory>
|
2013-07-03 10:46:07 +02:00
|
|
|
|
|
|
|
#include <renderwure/render/ViewCamera.hpp>
|
2013-07-02 09:53:23 +02:00
|
|
|
|
2013-07-04 03:40:47 +02:00
|
|
|
class Model;
|
2013-07-02 09:53:23 +02:00
|
|
|
class GTAEngine;
|
2013-07-22 05:39:58 +02:00
|
|
|
class GTAVehicle;
|
|
|
|
|
2013-07-02 09:53:23 +02:00
|
|
|
class GTARenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
GTARenderer();
|
|
|
|
|
|
|
|
ViewCamera camera;
|
|
|
|
|
2013-07-02 10:58:01 +02:00
|
|
|
/// The numer of things rendered by the last renderWorld
|
|
|
|
size_t rendered;
|
|
|
|
size_t culled;
|
2013-07-03 10:46:07 +02:00
|
|
|
|
2013-07-05 03:15:29 +02:00
|
|
|
GLint uniModel, uniProj, uniView, uniCol, uniAmbientCol, uniSunDirection, uniDynamicCol;
|
|
|
|
GLint uniMatDiffuse, uniMatAmbient, uniFogStart, uniFogEnd;
|
|
|
|
GLint posAttrib, normalAttrib, texAttrib, colourAttrib;
|
2013-07-03 10:46:07 +02:00
|
|
|
GLuint worldProgram;
|
2013-07-05 03:15:29 +02:00
|
|
|
GLuint skyProgram;
|
|
|
|
GLint skyUniView, skyUniProj, skyUniTop, skyUniBottom;
|
2013-07-02 10:58:01 +02:00
|
|
|
|
2013-07-06 02:39:54 +02:00
|
|
|
/// Internal VAO to avoid clobbering global state.
|
|
|
|
GLuint vao;
|
|
|
|
|
2013-07-05 03:15:29 +02:00
|
|
|
GLuint planeVBO, skydomeVBO;
|
2013-07-04 12:43:28 +02:00
|
|
|
|
2013-07-02 09:53:23 +02:00
|
|
|
void renderWorld(GTAEngine* engine);
|
2013-07-04 03:40:47 +02:00
|
|
|
|
|
|
|
void renderNamedFrame(GTAEngine* engine, const std::unique_ptr<Model>&, const glm::vec3& pos, const glm::quat& rot, const glm::vec3& scale, const std::string& name);
|
|
|
|
|
|
|
|
void renderObject(GTAEngine* engine, const std::unique_ptr<Model>&, const glm::vec3& pos, const glm::quat& rot, const glm::vec3& scale);
|
2013-07-22 05:39:58 +02:00
|
|
|
|
|
|
|
void renderGeometry(GTAEngine* engine, const std::unique_ptr<Model>&, size_t geom, const glm::mat4& modelMatrix, GTAVehicle* vehicle = nullptr);
|
2013-07-02 09:53:23 +02:00
|
|
|
};
|
|
|
|
|
2013-07-22 05:39:58 +02:00
|
|
|
#endif
|