ArchitectureColoredPainting/ArchitectureColoredPainting/PaintingHelper.h

30 lines
905 B
C++

#pragma once
#include <vector>
#include <QDebug>
#include <QVector4D>
#include <QOpenGLFunctions_4_5_Compatibility>
#include "BvhTree.h"
class PaintingHelper
{
private:
QOpenGLFunctions_4_5_Compatibility* glFunc;
GLuint paintingOffsetsSSBO, bvhSSBO, bvhBoundSSBO, elementOffsetSSBO, elementIndexSSBO, elementDataSSBO;
std::vector<GLuint> paintingOffsets;
std::vector<GLuint> bvhChildren;
std::vector<QVector4D> bvhBound;
std::vector<GLuint> elementOffset;
std::vector<GLuint> elementIndex;
std::vector<GLfloat> elementData;
int paintingCount = 0;
public:
PaintingHelper(QOpenGLFunctions_4_5_Compatibility* glFunc);
int addPainting(GLuint paintingBvhLength, std::vector<GLuint> bvhChildren, std::vector<QVector4D> bvhBound,
std::vector<GLuint> elementOffset, std::vector<GLuint> elementIndex, std::vector<GLfloat> elementData);
void allocateBuffers();
void bindPaintingBuffers();
};