fa8808fea8
signal-slot for openFile, resetView on openFile, cleanup when open a new file, triangulate quad poly now correctly, more not working, bug from previous version, next: fix 5,6,.. triangulation, triClothMan, IC Helmet, still buggy,
43 lines
804 B
C++
43 lines
804 B
C++
#pragma once
|
|
#include "..\Header\FileInterface.h"
|
|
#include <QObject>
|
|
#include <QOpenGLFunctions>
|
|
#include <QOpenGLShaderProgram>
|
|
#include <QOpenGLBuffer>
|
|
#include <QOpenGLTexture>
|
|
#include <QVector>
|
|
|
|
struct DrawInformation {
|
|
unsigned int offset;
|
|
unsigned int size;
|
|
unsigned int textureIndex;
|
|
QMatrix4x4 modelMatrix;
|
|
};
|
|
|
|
class GeometryEngine : public QObject, protected QOpenGLFunctions
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
GeometryEngine();
|
|
virtual ~GeometryEngine();
|
|
|
|
private:
|
|
QOpenGLBuffer m_arrayBuf;
|
|
QOpenGLBuffer m_indexBuf;
|
|
QVector<QOpenGLTexture*> m_textures;
|
|
QVector<DrawInformation> m_drawList;
|
|
|
|
void loadTexture(const char* filePath);
|
|
void clearData();
|
|
|
|
public slots:
|
|
void loadFile(const char* filePath);
|
|
void drawGeometry(QOpenGLShaderProgram *program);
|
|
|
|
signals:
|
|
void requestResetView();
|
|
|
|
};
|
|
|