git-svn-id: svn://db.shs.com.ru/libs@663 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
58
qglengine/core/glvertexobject.h
Normal file
58
qglengine/core/glvertexobject.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
QGLView
|
||||
Copyright (C) 2019 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GLVERTEXOBJECT_H
|
||||
#define GLVERTEXOBJECT_H
|
||||
|
||||
#include "glbuffer.h"
|
||||
#include "glshaders_types.h"
|
||||
|
||||
|
||||
class VertexObject
|
||||
{
|
||||
friend class Mesh;
|
||||
public:
|
||||
VertexObject();
|
||||
~VertexObject();
|
||||
|
||||
void init (QOpenGLExtraFunctions * f);
|
||||
void destroy (QOpenGLExtraFunctions * f);
|
||||
|
||||
void bind (QOpenGLExtraFunctions * f);
|
||||
void release (QOpenGLExtraFunctions * f);
|
||||
|
||||
void bindBuffers (QOpenGLExtraFunctions * f, Buffer & geom, Buffer & elem);
|
||||
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 draw(QOpenGLExtraFunctions * f, GLenum geom_type, int vert_cout, int obj_count);
|
||||
|
||||
GLuint ID() const {return vao_;}
|
||||
bool isInit() const {return vao_ != 0;}
|
||||
|
||||
private:
|
||||
void loadBuffer(QOpenGLExtraFunctions * f, Buffer & buf, const void * data, int size);
|
||||
|
||||
GLuint vao_;
|
||||
Buffer buffer_obj, buffer_sel;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // GLVERTEXOBJECT_H
|
||||
Reference in New Issue
Block a user