git-svn-id: svn://db.shs.com.ru/libs@664 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-12-09 20:36:54 +00:00
parent 1a210defb1
commit 86f4e0ad78
4 changed files with 48 additions and 23 deletions

View File

@@ -41,16 +41,16 @@ public:
void init (QOpenGLExtraFunctions * f);
void destroy (QOpenGLExtraFunctions * f);
bool rebuffer(QOpenGLExtraFunctions * f);
void draw (QOpenGLExtraFunctions * f, int count);
void draw (QOpenGLExtraFunctions * f, int count, int type = 0);
void clear();
void loadObject (QOpenGLExtraFunctions * f, const QGLEngineShaders::Object & object);
void loadObjects (QOpenGLExtraFunctions * f, const QVector<QGLEngineShaders::Object> & objects);
void loadSelections(QOpenGLExtraFunctions * f, const QVector<uchar> & sels);
void loadObject (QOpenGLExtraFunctions * f, const QGLEngineShaders::Object & object, int type = 0);
void loadObjects (QOpenGLExtraFunctions * f, const QVector<QGLEngineShaders::Object> & objects, int type = 0);
void loadSelections(QOpenGLExtraFunctions * f, const QVector<uchar> & sels, int type = 0);
int verticesCount() const {return vertices_.size();}
int trianglesCount() const {return triangles_.size();}
int linesCount() const {return lines_.size();}
bool isInit() const {return vao.isInit();}
bool isInit() const {return buffer_geom.isInit();}
bool isEmpty() const {return vertices_.isEmpty();}
uint hash() const;
@@ -78,6 +78,7 @@ public:
private:
void calculateNormals();
void calculateTangents();
VertexObject * vaoByType(int type);
QVector<QVector3D> vertices_, normals_, tangents_, bitangents_;
QVector<QVector2D> texcoords_;
@@ -87,7 +88,7 @@ private:
QVector<QGLEngineShaders::Vertex> data_;
GLenum geom_type;
Buffer buffer_geom, buffer_ind;
VertexObject vao;
QMap<int, VertexObject * > vao_map;
mutable uint hash_;
mutable bool hash_changed;
int vert_count;