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

44 lines
830 B
C
Raw Normal View History

2016-12-29 12:37:15 +00:00
#pragma once
#include "..\Header\FileInterface.h"
#include <QObject>
#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 : public QObject, protected QOpenGLFunctions
{
Q_OBJECT
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;
BoundingBox m_boundings;
void loadTexture(const char* filePath);
void clearData();
2016-12-29 12:37:15 +00:00
public slots:
void loadFile(const char* filePath);
2016-12-29 13:06:25 +00:00
void drawGeometry(QOpenGLShaderProgram *program);
signals:
void requestResetView();
};