New OpenGLSharedState class to manage shader variables
This commit is contained in:
parent
994dcb5f44
commit
666420bbb2
16 changed files with 237 additions and 66 deletions
|
@ -7,7 +7,6 @@
|
||||||
#include "CameraDefinition.h"
|
#include "CameraDefinition.h"
|
||||||
#include "AtmosphereDefinition.h"
|
#include "AtmosphereDefinition.h"
|
||||||
#include "AtmosphereRenderer.h"
|
#include "AtmosphereRenderer.h"
|
||||||
#include "WaterRenderer.h"
|
|
||||||
#include "Scenery.h"
|
#include "Scenery.h"
|
||||||
|
|
||||||
OpenGLPart::OpenGLPart(OpenGLRenderer* renderer):
|
OpenGLPart::OpenGLPart(OpenGLRenderer* renderer):
|
||||||
|
@ -27,7 +26,7 @@ OpenGLPart::~OpenGLPart()
|
||||||
|
|
||||||
OpenGLShaderProgram* OpenGLPart::createShader(QString name)
|
OpenGLShaderProgram* OpenGLPart::createShader(QString name)
|
||||||
{
|
{
|
||||||
OpenGLShaderProgram* program = new OpenGLShaderProgram(name, renderer->getOpenGlFunctions());
|
OpenGLShaderProgram* program = new OpenGLShaderProgram(name, renderer);
|
||||||
|
|
||||||
if (!shaders.contains(name))
|
if (!shaders.contains(name))
|
||||||
{
|
{
|
||||||
|
@ -82,25 +81,6 @@ void OpenGLPart::updateCamera(CameraDefinition* camera)
|
||||||
|
|
||||||
void OpenGLPart::updateScenery(bool onlyCommon)
|
void OpenGLPart::updateScenery(bool onlyCommon)
|
||||||
{
|
{
|
||||||
Scenery* scenery = renderer->getScenery();
|
|
||||||
|
|
||||||
// Collect common info
|
|
||||||
double water_height = renderer->getWaterRenderer()->getHeightInfo().max_height;
|
|
||||||
Vector3 orig_sun_direction = renderer->getAtmosphereRenderer()->getSunDirection();
|
|
||||||
QVector3D sun_direction = QVector3D(orig_sun_direction.x, orig_sun_direction.y, orig_sun_direction.z);
|
|
||||||
Color orig_sun_color = scenery->getAtmosphere()->sun_color;
|
|
||||||
QColor sun_color = QColor(orig_sun_color.r, orig_sun_color.g, orig_sun_color.b);
|
|
||||||
|
|
||||||
// Update shaders
|
|
||||||
QMapIterator<QString, OpenGLShaderProgram*> i(shaders);
|
|
||||||
while (i.hasNext())
|
|
||||||
{
|
|
||||||
i.next();
|
|
||||||
|
|
||||||
i.value()->updateWaterHeight(water_height);
|
|
||||||
i.value()->updateSun(sun_direction, sun_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Let subclass do its own collecting
|
// Let subclass do its own collecting
|
||||||
if (not onlyCommon)
|
if (not onlyCommon)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <QOpenGLFunctions_3_2_Core>
|
#include <QOpenGLFunctions_3_2_Core>
|
||||||
#include "CameraDefinition.h"
|
#include "CameraDefinition.h"
|
||||||
|
#include "OpenGLSharedState.h"
|
||||||
#include "OpenGLSkybox.h"
|
#include "OpenGLSkybox.h"
|
||||||
#include "OpenGLWater.h"
|
#include "OpenGLWater.h"
|
||||||
|
|
||||||
|
@ -9,6 +10,8 @@ OpenGLRenderer::OpenGLRenderer(Scenery* scenery):
|
||||||
SoftwareRenderer(scenery)
|
SoftwareRenderer(scenery)
|
||||||
{
|
{
|
||||||
functions = new QOpenGLFunctions_3_2_Core();
|
functions = new QOpenGLFunctions_3_2_Core();
|
||||||
|
shared_state = new OpenGLSharedState();
|
||||||
|
|
||||||
skybox = new OpenGLSkybox(this);
|
skybox = new OpenGLSkybox(this);
|
||||||
water = new OpenGLWater(this);
|
water = new OpenGLWater(this);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +20,9 @@ OpenGLRenderer::~OpenGLRenderer()
|
||||||
{
|
{
|
||||||
delete skybox;
|
delete skybox;
|
||||||
delete water;
|
delete water;
|
||||||
|
|
||||||
delete functions;
|
delete functions;
|
||||||
|
delete shared_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLRenderer::initialize()
|
void OpenGLRenderer::initialize()
|
||||||
|
|
|
@ -25,13 +25,15 @@ public:
|
||||||
|
|
||||||
void cameraChangeEvent(CameraDefinition* camera);
|
void cameraChangeEvent(CameraDefinition* camera);
|
||||||
|
|
||||||
inline QOpenGLFunctions_3_2_Core* getOpenGlFunctions() {return functions;}
|
inline QOpenGLFunctions_3_2_Core* getOpenGlFunctions() const {return functions;}
|
||||||
|
inline OpenGLSharedState* getSharedState() const {return shared_state;}
|
||||||
|
|
||||||
virtual double getPrecision(const Vector3 &location) override;
|
virtual double getPrecision(const Vector3 &location) override;
|
||||||
virtual Color applyMediumTraversal(Vector3 location, Color color) override;
|
virtual Color applyMediumTraversal(Vector3 location, Color color) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QOpenGLFunctions_3_2_Core* functions;
|
QOpenGLFunctions_3_2_Core* functions;
|
||||||
|
OpenGLSharedState* shared_state;
|
||||||
|
|
||||||
OpenGLSkybox* skybox;
|
OpenGLSkybox* skybox;
|
||||||
OpenGLWater* water;
|
OpenGLWater* water;
|
||||||
|
|
|
@ -3,15 +3,18 @@
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
#include <QOpenGLFunctions_3_2_Core>
|
#include <QOpenGLFunctions_3_2_Core>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
|
#include "OpenGLSharedState.h"
|
||||||
#include "Texture2D.h"
|
#include "Texture2D.h"
|
||||||
#include "Texture3D.h"
|
#include "Texture3D.h"
|
||||||
#include "Texture4D.h"
|
#include "Texture4D.h"
|
||||||
#include "Color.h"
|
#include "Color.h"
|
||||||
|
|
||||||
OpenGLShaderProgram::OpenGLShaderProgram(QString name, QOpenGLFunctions_3_2_Core* functions):
|
OpenGLShaderProgram::OpenGLShaderProgram(QString name, OpenGLRenderer* renderer):
|
||||||
name(name), functions(functions)
|
renderer(renderer), name(name)
|
||||||
{
|
{
|
||||||
program = new QOpenGLShaderProgram();
|
program = new QOpenGLShaderProgram();
|
||||||
|
functions = renderer->getOpenGlFunctions();
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenGLShaderProgram::~OpenGLShaderProgram()
|
OpenGLShaderProgram::~OpenGLShaderProgram()
|
||||||
|
@ -47,17 +50,6 @@ void OpenGLShaderProgram::updateCamera(const QVector3D& location, const QMatrix4
|
||||||
this->view = view;
|
this->view = view;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLShaderProgram::updateWaterHeight(double height)
|
|
||||||
{
|
|
||||||
this->water_height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenGLShaderProgram::updateSun(const QVector3D& direction, const QColor& color)
|
|
||||||
{
|
|
||||||
this->sun_direction = direction;
|
|
||||||
this->sun_color = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenGLShaderProgram::addTexture(QString sampler_name, Texture2D* texture)
|
void OpenGLShaderProgram::addTexture(QString sampler_name, Texture2D* texture)
|
||||||
{
|
{
|
||||||
GLuint texid;
|
GLuint texid;
|
||||||
|
@ -193,6 +185,8 @@ void OpenGLShaderProgram::bind()
|
||||||
{
|
{
|
||||||
program->bind();
|
program->bind();
|
||||||
|
|
||||||
|
renderer->getSharedState()->apply(this);
|
||||||
|
|
||||||
// TODO Keep locations in cache
|
// TODO Keep locations in cache
|
||||||
|
|
||||||
int viewMatrix = program->uniformLocation("viewMatrix");
|
int viewMatrix = program->uniformLocation("viewMatrix");
|
||||||
|
@ -207,24 +201,6 @@ void OpenGLShaderProgram::bind()
|
||||||
program->setUniformValue(cameraLocation, camera_location);
|
program->setUniformValue(cameraLocation, camera_location);
|
||||||
}
|
}
|
||||||
|
|
||||||
int waterHeight = program->uniformLocation("waterHeight");
|
|
||||||
if (waterHeight >= 0)
|
|
||||||
{
|
|
||||||
program->setUniformValue(waterHeight, water_height);
|
|
||||||
}
|
|
||||||
|
|
||||||
int sunDirection = program->uniformLocation("sunDirection");
|
|
||||||
if (sunDirection >= 0)
|
|
||||||
{
|
|
||||||
program->setUniformValue(sunDirection, sun_direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
int sunColor = program->uniformLocation("sunColor");
|
|
||||||
if (sunColor >= 0)
|
|
||||||
{
|
|
||||||
program->setUniformValue(sunColor, sun_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
QMapIterator<QString, QPair<int, unsigned int> > iter(textures);
|
QMapIterator<QString, QPair<int, unsigned int> > iter(textures);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (iter.hasNext())
|
while (iter.hasNext())
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace opengl {
|
||||||
class OPENGLSHARED_EXPORT OpenGLShaderProgram
|
class OPENGLSHARED_EXPORT OpenGLShaderProgram
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OpenGLShaderProgram(QString name, QOpenGLFunctions_3_2_Core* functions);
|
OpenGLShaderProgram(QString name, OpenGLRenderer* renderer);
|
||||||
~OpenGLShaderProgram();
|
~OpenGLShaderProgram();
|
||||||
|
|
||||||
void addVertexSource(QString path);
|
void addVertexSource(QString path);
|
||||||
|
@ -26,8 +26,6 @@ public:
|
||||||
void compile();
|
void compile();
|
||||||
|
|
||||||
void updateCamera(const QVector3D& location, const QMatrix4x4& view);
|
void updateCamera(const QVector3D& location, const QMatrix4x4& view);
|
||||||
void updateWaterHeight(double height);
|
|
||||||
void updateSun(const QVector3D& direction, const QColor& color);
|
|
||||||
|
|
||||||
void addTexture(QString sampler_name, Texture2D* texture);
|
void addTexture(QString sampler_name, Texture2D* texture);
|
||||||
void addTexture(QString sampler_name, Texture3D* texture);
|
void addTexture(QString sampler_name, Texture3D* texture);
|
||||||
|
@ -36,18 +34,19 @@ public:
|
||||||
void drawTriangles(float* vertices, int triangle_count);
|
void drawTriangles(float* vertices, int triangle_count);
|
||||||
void drawTriangleStrip(float* vertices, int vertex_count);
|
void drawTriangleStrip(float* vertices, int vertex_count);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
inline QOpenGLShaderProgram* getProgram() const {return program;}
|
||||||
|
friend class OpenGLVariable;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void bind();
|
void bind();
|
||||||
void release();
|
void release();
|
||||||
|
|
||||||
|
OpenGLRenderer* renderer;
|
||||||
|
|
||||||
QMatrix4x4 view;
|
QMatrix4x4 view;
|
||||||
QVector3D camera_location;
|
QVector3D camera_location;
|
||||||
|
|
||||||
float water_height;
|
|
||||||
|
|
||||||
QVector3D sun_direction;
|
|
||||||
QColor sun_color;
|
|
||||||
|
|
||||||
QString name;
|
QString name;
|
||||||
QOpenGLShaderProgram* program;
|
QOpenGLShaderProgram* program;
|
||||||
QOpenGLFunctions_3_2_Core* functions;
|
QOpenGLFunctions_3_2_Core* functions;
|
||||||
|
|
23
src/render/opengl/OpenGLSharedState.cpp
Normal file
23
src/render/opengl/OpenGLSharedState.cpp
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#include "OpenGLSharedState.h"
|
||||||
|
|
||||||
|
OpenGLSharedState::OpenGLSharedState()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenGLSharedState::apply(OpenGLShaderProgram *program)
|
||||||
|
{
|
||||||
|
for (const auto &pair : variables)
|
||||||
|
{
|
||||||
|
pair.second->apply(program);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OpenGLVariable *OpenGLSharedState::get(const std::string &name)
|
||||||
|
{
|
||||||
|
OpenGLVariable*& var = variables[name];
|
||||||
|
if (var == 0)
|
||||||
|
{
|
||||||
|
var = new OpenGLVariable(name);
|
||||||
|
}
|
||||||
|
return var;
|
||||||
|
}
|
46
src/render/opengl/OpenGLSharedState.h
Normal file
46
src/render/opengl/OpenGLSharedState.h
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
#ifndef OPENGLSHAREDSTATE_H
|
||||||
|
#define OPENGLSHAREDSTATE_H
|
||||||
|
|
||||||
|
#include "opengl_global.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include "OpenGLVariable.h"
|
||||||
|
|
||||||
|
namespace paysages {
|
||||||
|
namespace opengl {
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief OpenGL variables that can be shared between shaders.
|
||||||
|
*/
|
||||||
|
class OPENGLSHARED_EXPORT OpenGLSharedState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OpenGLSharedState();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Apply the stored variables to the bound program.
|
||||||
|
*/
|
||||||
|
void apply(OpenGLShaderProgram* program);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Get or create a variable in the state.
|
||||||
|
*/
|
||||||
|
OpenGLVariable *get(const std::string &name);
|
||||||
|
|
||||||
|
// Shortcuts
|
||||||
|
inline void set(const std::string &name, const Texture2D *texture) {get(name)->set(texture);}
|
||||||
|
inline void set(const std::string &name, const Texture3D *texture) {get(name)->set(texture);}
|
||||||
|
inline void set(const std::string &name, const Texture4D *texture) {get(name)->set(texture);}
|
||||||
|
inline void set(const std::string &name, float value) {get(name)->set(value);}
|
||||||
|
inline void set(const std::string &name, const Vector3 &vector) {get(name)->set(vector);}
|
||||||
|
inline void set(const std::string &name, const Matrix4 &matrix) {get(name)->set(matrix);}
|
||||||
|
inline void set(const std::string &name, const Color &color) {get(name)->set(color);}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::map<std::string, OpenGLVariable*> variables;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // OPENGLSHAREDSTATE_H
|
|
@ -3,6 +3,7 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "OpenGLRenderer.h"
|
#include "OpenGLRenderer.h"
|
||||||
#include "OpenGLShaderProgram.h"
|
#include "OpenGLShaderProgram.h"
|
||||||
|
#include "OpenGLSharedState.h"
|
||||||
#include "Scenery.h"
|
#include "Scenery.h"
|
||||||
#include "AtmosphereDefinition.h"
|
#include "AtmosphereDefinition.h"
|
||||||
#include "AtmosphereRenderer.h"
|
#include "AtmosphereRenderer.h"
|
||||||
|
@ -51,8 +52,13 @@ void OpenGLSkybox::initialize()
|
||||||
|
|
||||||
void OpenGLSkybox::update()
|
void OpenGLSkybox::update()
|
||||||
{
|
{
|
||||||
SoftwareBrunetonAtmosphereRenderer* bruneton = (SoftwareBrunetonAtmosphereRenderer*)renderer->getAtmosphereRenderer();
|
Vector3 sun_direction = renderer->getAtmosphereRenderer()->getSunDirection();
|
||||||
|
renderer->getSharedState()->set("sunDirection", sun_direction);
|
||||||
|
|
||||||
|
Color sun_color = renderer->getScenery()->getAtmosphere()->sun_color;
|
||||||
|
renderer->getSharedState()->set("sunColor", sun_color);
|
||||||
|
|
||||||
|
SoftwareBrunetonAtmosphereRenderer* bruneton = (SoftwareBrunetonAtmosphereRenderer*)renderer->getAtmosphereRenderer();
|
||||||
program->addTexture("transmittanceTexture", bruneton->getModel()->getTextureTransmittance());
|
program->addTexture("transmittanceTexture", bruneton->getModel()->getTextureTransmittance());
|
||||||
program->addTexture("inscatterTexture", bruneton->getModel()->getTextureInscatter());
|
program->addTexture("inscatterTexture", bruneton->getModel()->getTextureInscatter());
|
||||||
}
|
}
|
||||||
|
|
57
src/render/opengl/OpenGLVariable.cpp
Normal file
57
src/render/opengl/OpenGLVariable.cpp
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#include "OpenGLVariable.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
#include <QOpenGLShaderProgram>
|
||||||
|
#include "OpenGLShaderProgram.h"
|
||||||
|
#include "Vector3.h"
|
||||||
|
#include "Color.h"
|
||||||
|
|
||||||
|
OpenGLVariable::OpenGLVariable(const std::string &name):
|
||||||
|
name(name)
|
||||||
|
{
|
||||||
|
type = TYPE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenGLVariable::apply(OpenGLShaderProgram *program)
|
||||||
|
{
|
||||||
|
QOpenGLShaderProgram* pr = program->getProgram();
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case TYPE_FLOAT:
|
||||||
|
pr->setUniformValue(name.c_str(), value_float);
|
||||||
|
break;
|
||||||
|
case TYPE_COLOR:
|
||||||
|
pr->setUniformValue(name.c_str(), value_color);
|
||||||
|
break;
|
||||||
|
case TYPE_VECTOR3:
|
||||||
|
pr->setUniformValue(name.c_str(), value_vector3);
|
||||||
|
break;
|
||||||
|
case TYPE_NONE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenGLVariable::set(float value)
|
||||||
|
{
|
||||||
|
assert(type == TYPE_NONE or type == TYPE_FLOAT);
|
||||||
|
|
||||||
|
type = TYPE_FLOAT;
|
||||||
|
value_float = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenGLVariable::set(const Vector3 &vector)
|
||||||
|
{
|
||||||
|
assert(type == TYPE_NONE or type == TYPE_COLOR);
|
||||||
|
|
||||||
|
type = TYPE_VECTOR3;
|
||||||
|
value_vector3 = QVector3D(vector.x, vector.y, vector.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenGLVariable::set(const Color &color)
|
||||||
|
{
|
||||||
|
assert(type == TYPE_NONE or type == TYPE_COLOR);
|
||||||
|
|
||||||
|
type = TYPE_COLOR;
|
||||||
|
value_color = QColor(color.r, color.g, color.b);
|
||||||
|
}
|
54
src/render/opengl/OpenGLVariable.h
Normal file
54
src/render/opengl/OpenGLVariable.h
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#ifndef OPENGLVARIABLE_H
|
||||||
|
#define OPENGLVARIABLE_H
|
||||||
|
|
||||||
|
#include "opengl_global.h"
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QVector3D>
|
||||||
|
|
||||||
|
namespace paysages {
|
||||||
|
namespace opengl {
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief OpenGL variable that can be bound to a uniform for shaders.
|
||||||
|
*/
|
||||||
|
class OpenGLVariable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef enum {
|
||||||
|
TYPE_NONE,
|
||||||
|
TYPE_TEXTURE_2D,
|
||||||
|
TYPE_TEXTURE_3D,
|
||||||
|
TYPE_TEXTURE_4D,
|
||||||
|
TYPE_FLOAT,
|
||||||
|
TYPE_VECTOR3,
|
||||||
|
TYPE_MATRIX4,
|
||||||
|
TYPE_COLOR
|
||||||
|
} OpenGLVariableType;
|
||||||
|
|
||||||
|
public:
|
||||||
|
OpenGLVariable(const std::string &name);
|
||||||
|
|
||||||
|
void apply(OpenGLShaderProgram *program);
|
||||||
|
|
||||||
|
void set(const Texture2D *texture);
|
||||||
|
void set(const Texture3D *texture);
|
||||||
|
void set(const Texture4D *texture);
|
||||||
|
void set(float value);
|
||||||
|
void set(const Vector3 &vector);
|
||||||
|
void set(const Matrix4 &matrix);
|
||||||
|
void set(const Color &color);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string name;
|
||||||
|
OpenGLVariableType type;
|
||||||
|
|
||||||
|
float value_float;
|
||||||
|
QColor value_color;
|
||||||
|
QVector3D value_vector3;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // OPENGLVARIABLE_H
|
|
@ -1,6 +1,9 @@
|
||||||
#include "OpenGLWater.h"
|
#include "OpenGLWater.h"
|
||||||
|
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
#include "OpenGLShaderProgram.h"
|
#include "OpenGLShaderProgram.h"
|
||||||
|
#include "OpenGLSharedState.h"
|
||||||
|
#include "WaterRenderer.h"
|
||||||
|
|
||||||
OpenGLWater::OpenGLWater(OpenGLRenderer *renderer):
|
OpenGLWater::OpenGLWater(OpenGLRenderer *renderer):
|
||||||
OpenGLPart(renderer)
|
OpenGLPart(renderer)
|
||||||
|
@ -27,6 +30,8 @@ void OpenGLWater::initialize()
|
||||||
|
|
||||||
void OpenGLWater::update()
|
void OpenGLWater::update()
|
||||||
{
|
{
|
||||||
|
double water_height = renderer->getWaterRenderer()->getHeightInfo().max_height;
|
||||||
|
renderer->getSharedState()->set("waterHeight", water_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLWater::render()
|
void OpenGLWater::render()
|
||||||
|
|
|
@ -21,7 +21,9 @@ SOURCES += \
|
||||||
OpenGLShaderProgram.cpp \
|
OpenGLShaderProgram.cpp \
|
||||||
OpenGLPart.cpp \
|
OpenGLPart.cpp \
|
||||||
OpenGLSkybox.cpp \
|
OpenGLSkybox.cpp \
|
||||||
OpenGLWater.cpp
|
OpenGLWater.cpp \
|
||||||
|
OpenGLSharedState.cpp \
|
||||||
|
OpenGLVariable.cpp
|
||||||
|
|
||||||
HEADERS +=\
|
HEADERS +=\
|
||||||
opengl_global.h \
|
opengl_global.h \
|
||||||
|
@ -32,7 +34,9 @@ HEADERS +=\
|
||||||
OpenGLShaderProgram.h \
|
OpenGLShaderProgram.h \
|
||||||
OpenGLPart.h \
|
OpenGLPart.h \
|
||||||
OpenGLSkybox.h \
|
OpenGLSkybox.h \
|
||||||
OpenGLWater.h
|
OpenGLWater.h \
|
||||||
|
OpenGLSharedState.h \
|
||||||
|
OpenGLVariable.h
|
||||||
|
|
||||||
unix:!symbian {
|
unix:!symbian {
|
||||||
maemo5 {
|
maemo5 {
|
||||||
|
|
|
@ -17,6 +17,8 @@ namespace opengl {
|
||||||
class OpenGLRenderer;
|
class OpenGLRenderer;
|
||||||
class BaseExplorerChunk;
|
class BaseExplorerChunk;
|
||||||
class OpenGLShaderProgram;
|
class OpenGLShaderProgram;
|
||||||
|
class OpenGLSharedState;
|
||||||
|
class OpenGLVariable;
|
||||||
class OpenGLSkybox;
|
class OpenGLSkybox;
|
||||||
class OpenGLWater;
|
class OpenGLWater;
|
||||||
}
|
}
|
||||||
|
|
1
src/system/Logs.cpp
Normal file
1
src/system/Logs.cpp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#include "Logs.h"
|
9
src/system/Logs.h
Normal file
9
src/system/Logs.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef LOGS_H
|
||||||
|
#define LOGS_H
|
||||||
|
|
||||||
|
#include "system_global.h"
|
||||||
|
|
||||||
|
#define logWarning qWarning
|
||||||
|
#define logError qError
|
||||||
|
|
||||||
|
#endif // LOGS_H
|
|
@ -23,7 +23,8 @@ SOURCES += \
|
||||||
ParallelWork.cpp \
|
ParallelWork.cpp \
|
||||||
ParallelQueue.cpp \
|
ParallelQueue.cpp \
|
||||||
CacheFile.cpp \
|
CacheFile.cpp \
|
||||||
PictureWriter.cpp
|
PictureWriter.cpp \
|
||||||
|
Logs.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
system_global.h \
|
system_global.h \
|
||||||
|
@ -36,7 +37,8 @@ HEADERS += \
|
||||||
ParallelWork.h \
|
ParallelWork.h \
|
||||||
ParallelQueue.h \
|
ParallelQueue.h \
|
||||||
CacheFile.h \
|
CacheFile.h \
|
||||||
PictureWriter.h
|
PictureWriter.h \
|
||||||
|
Logs.h
|
||||||
|
|
||||||
unix:!symbian {
|
unix:!symbian {
|
||||||
maemo5 {
|
maemo5 {
|
||||||
|
|
Loading…
Reference in a new issue