GeometryEngine.h 696 Bytes
Newer Older
Anakin's avatar
Anakin committed
1
#pragma once
Anakin's avatar
Anakin committed
2
#include "..\Header\FileInterface.h"
3 4 5
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
Anakin's avatar
Anakin committed
6
#include <QOpenGLTexture>
Anakin's avatar
Anakin committed
7
#include <QVector>
8

Anakin's avatar
Anakin committed
9 10 11 12 13 14 15
struct DrawInformation {
	unsigned int offset;
	unsigned int size;
	unsigned int textureIndex;
	QMatrix4x4 modelMatrix;
};

16 17 18
class GeometryEngine : protected QOpenGLFunctions
{
public:
Anakin's avatar
Anakin committed
19 20
	GeometryEngine();
	virtual ~GeometryEngine();
21 22

private:
Anakin's avatar
Anakin committed
23 24 25
	QOpenGLBuffer m_arrayBuf;
	QOpenGLBuffer m_indexBuf;
	QVector<QOpenGLTexture*> m_textures;
Anakin's avatar
Anakin committed
26
	QVector<DrawInformation> m_drawList;
Anakin's avatar
Anakin committed
27

Anakin's avatar
Anakin committed
28
	void loadTexture(const char* filePath);
Anakin's avatar
Anakin committed
29

Anakin's avatar
Anakin committed
30
public:
Anakin's avatar
Anakin committed
31
	void loadFile(const char* filePath);
Anakin's avatar
Anakin committed
32
	void drawGeometry(QOpenGLShaderProgram *program);
33 34
};