1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-08 03:42:35 +01:00
openrw/framework2/include/renderwure/render/GTARenderer.hpp

48 lines
1.3 KiB
C++
Raw Normal View History

2013-07-02 09:53:23 +02:00
#ifndef _GTARENDERER_HPP_
#define _GTARENDERER_HPP_
#define GLEW_STATIC
#include <GL/glew.h>
2013-07-04 03:40:47 +02:00
#include <memory>
#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;
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-05 03:15:29 +02:00
GLint uniModel, uniProj, uniView, uniCol, uniAmbientCol, uniSunDirection, uniDynamicCol;
GLint uniMatDiffuse, uniMatAmbient, uniFogStart, uniFogEnd;
GLint posAttrib, normalAttrib, texAttrib, colourAttrib;
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
/// 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);
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
};
#endif