Work on making OpenGLExample work with common example framework.

This commit is contained in:
David Williams
2014-05-23 22:44:58 +02:00
parent 34f57911a7
commit 6cbb2d44bf
3 changed files with 74 additions and 32 deletions

View File

@ -53,6 +53,11 @@ public:
// The viewable region can be adjusted so that this example framework can be use for different volume sizes.
void setViewableRegion(PolyVox::Region viewableRegion);
void setShader(QGLShaderProgram* shader)
{
this->shader = shader;
}
// Convert a SurfaceMesh to OpenGL index/vertex buffers. Inlined because it's templatised.
template <typename MeshType>
void addMesh(const MeshType& surfaceMesh)
@ -107,7 +112,11 @@ private:
// Index/vertex buffer data
std::vector<OpenGLMeshData> mMeshData;
QGLShaderProgram shader;
QGLShaderProgram* shader;
// Matrices
QMatrix4x4 worldToCameraMatrix;
QMatrix4x4 cameraToClipMatrix;
// Mouse data
QPoint m_LastFrameMousePos;