2016-12-29 12:37:15 +00:00
|
|
|
#pragma once
|
2016-12-30 11:36:05 +00:00
|
|
|
#include "..\Header\FileInterface.h"
|
2016-12-24 15:03:37 +00:00
|
|
|
#include <QOpenGLFunctions>
|
|
|
|
#include <QOpenGLShaderProgram>
|
|
|
|
#include <QOpenGLBuffer>
|
2016-12-29 12:37:15 +00:00
|
|
|
#include <QOpenGLTexture>
|
2016-12-29 13:06:25 +00:00
|
|
|
#include <QVector>
|
2016-12-24 15:03:37 +00:00
|
|
|
|
|
|
|
class GeometryEngine : protected QOpenGLFunctions
|
|
|
|
{
|
|
|
|
public:
|
2016-12-29 12:37:15 +00:00
|
|
|
GeometryEngine();
|
|
|
|
virtual ~GeometryEngine();
|
2016-12-24 15:03:37 +00:00
|
|
|
|
|
|
|
private:
|
2016-12-29 13:06:25 +00:00
|
|
|
QOpenGLBuffer m_arrayBuf;
|
|
|
|
QOpenGLBuffer m_indexBuf;
|
|
|
|
QVector<QOpenGLTexture*> m_textures;
|
|
|
|
|
2016-12-30 11:36:05 +00:00
|
|
|
QVector<Model*>* m_models = Q_NULLPTR;
|
|
|
|
QVector<std::string>* m_textureNames = Q_NULLPTR; //TODO: remove, use it local and only hold the textures itself
|
|
|
|
|
2016-12-29 12:37:15 +00:00
|
|
|
void initCubeGeometry();
|
|
|
|
void initTexture();
|
|
|
|
|
2016-12-29 13:06:25 +00:00
|
|
|
public:
|
|
|
|
void drawGeometry(QOpenGLShaderProgram *program);
|
2016-12-24 15:03:37 +00:00
|
|
|
};
|
|
|
|
|