dust3d/application/sources/monochrome_opengl_object.h

26 lines
637 B
C
Raw Normal View History

2022-09-23 15:54:49 +00:00
#ifndef DUST3D_APPLICATION_MONOCHROME_OPENGL_OBJECT_H_
#define DUST3D_APPLICATION_MONOCHROME_OPENGL_OBJECT_H_
#include "monochrome_mesh.h"
2022-09-23 15:54:49 +00:00
#include <QMutex>
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>
#include <memory>
2022-09-23 15:54:49 +00:00
class MonochromeOpenGLObject {
2022-09-23 15:54:49 +00:00
public:
void update(std::unique_ptr<MonochromeMesh> mesh);
void draw();
2022-09-23 15:54:49 +00:00
private:
void copyMeshToOpenGL();
QOpenGLVertexArrayObject m_vertexArrayObject;
QOpenGLBuffer m_buffer;
std::unique_ptr<MonochromeMesh> m_mesh;
bool m_meshIsDirty = false;
QMutex m_meshMutex;
int m_meshLineVertexCount = 0;
};
#endif