mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-08 03:42:35 +01:00
946b9926ff
- Moved Rendering code around to reduce duplication - Added data for pedestrians
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
#ifndef _GTARENDERER_HPP_
|
|
#define _GTARENDERER_HPP_
|
|
|
|
#define GLEW_STATIC
|
|
#include <GL/glew.h>
|
|
#include <memory>
|
|
|
|
#include <renderwure/render/ViewCamera.hpp>
|
|
|
|
class Model;
|
|
class GTAEngine;
|
|
class GTAVehicle;
|
|
|
|
class GTARenderer
|
|
{
|
|
public:
|
|
|
|
GTARenderer();
|
|
|
|
ViewCamera camera;
|
|
|
|
/// The numer of things rendered by the last renderWorld
|
|
size_t rendered;
|
|
size_t culled;
|
|
|
|
GLint uniModel, uniProj, uniView, uniCol, uniAmbientCol, uniSunDirection, uniDynamicCol;
|
|
GLint uniMatDiffuse, uniMatAmbient, uniFogStart, uniFogEnd;
|
|
GLint posAttrib, normalAttrib, texAttrib, colourAttrib;
|
|
GLuint worldProgram;
|
|
GLuint skyProgram;
|
|
GLint skyUniView, skyUniProj, skyUniTop, skyUniBottom;
|
|
|
|
/// Internal VAO to avoid clobbering global state.
|
|
GLuint vao;
|
|
|
|
GLuint planeVBO, skydomeVBO;
|
|
|
|
void renderWorld(GTAEngine* engine);
|
|
|
|
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);
|
|
|
|
void renderGeometry(GTAEngine* engine, const std::unique_ptr<Model>&, size_t geom, const glm::mat4& modelMatrix, GTAVehicle* vehicle = nullptr);
|
|
};
|
|
|
|
#endif
|