SWBF2-Classic-Msh-Viewer/QtMeshViewer/Header/GeometryEngine.h

35 lines
664 B
C
Raw Normal View History

2016-12-29 12:37:15 +00:00
#pragma once
#include "..\Header\FileInterface.h"
#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>
struct DrawInformation {
unsigned int offset;
unsigned int size;
unsigned int textureIndex;
QMatrix4x4 modelMatrix;
};
class GeometryEngine : protected QOpenGLFunctions
{
public:
2016-12-29 12:37:15 +00:00
GeometryEngine();
virtual ~GeometryEngine();
private:
2016-12-29 13:06:25 +00:00
QOpenGLBuffer m_arrayBuf;
QOpenGLBuffer m_indexBuf;
QVector<QOpenGLTexture*> m_textures;
QVector<DrawInformation> m_drawList;
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);
};