NGL  6.5
The NCCA Graphics Library
MultiBufferVAO.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 Jon Macey
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef MULTIBUFFERVAO_H_
18 #define MULTIBUFFERVAO_H_
19 
20 #include "AbstractVAO.h"
21 #include <vector>
22 namespace ngl
23 {
24 //----------------------------------------------------------------------------------------------------------------------
32 //----------------------------------------------------------------------------------------------------------------------
33 
35 {
36  public :
37  //----------------------------------------------------------------------------------------------------------------------
41  //----------------------------------------------------------------------------------------------------------------------
42  static AbstractVAO *create(GLenum _mode=GL_TRIANGLES) { return new MultiBufferVAO(_mode); }
43  //----------------------------------------------------------------------------------------------------------------------
45  //----------------------------------------------------------------------------------------------------------------------
46  virtual void draw() const;
47  //----------------------------------------------------------------------------------------------------------------------
49  //----------------------------------------------------------------------------------------------------------------------
50  virtual ~MultiBufferVAO();
51  //----------------------------------------------------------------------------------------------------------------------
53  //----------------------------------------------------------------------------------------------------------------------
54  virtual void removeVAO();
55  //----------------------------------------------------------------------------------------------------------------------
58  //----------------------------------------------------------------------------------------------------------------------
59  virtual void setData(const VertexData &_data);
60  //----------------------------------------------------------------------------------------------------------------------
64  //----------------------------------------------------------------------------------------------------------------------
65  virtual GLuint getBufferID(unsigned int _id);
66  protected :
67  //----------------------------------------------------------------------------------------------------------------------
69  //----------------------------------------------------------------------------------------------------------------------
71  {
72 
73  }
74 
75  private :
76  //----------------------------------------------------------------------------------------------------------------------
78  //----------------------------------------------------------------------------------------------------------------------
79  std::vector <GLuint> m_vboIDs;
80 
81 
82 };
83 
84 
85 } // end namespace
86 
87 #endif
unsigned int GLuint
Definition: glew.h:280
#define NGL_DLLEXPORT
Definition: Types.h:65
static AbstractVAO * create(GLenum _mode=GL_TRIANGLES)
creator method for the factory
#define GL_TRIANGLES
Definition: glew.h:330
unsigned int GLenum
Definition: glew.h:278
implementation files for RibExport class
Definition: AABB.cpp:22
base class for all VAO from the VAOFactory this defines the base class type with simple draw / bind b...
Definition: AbstractVAO.h:34
std::vector< GLuint > m_vboIDs
the id of the buffers for the VAO
MultiBufferVAO(GLenum _mode)
ctor calles parent ctor to allocate vao;
Simple non index vao using multiple buffers see https://github.com/NCCA/VertexArrayObject/tree/master...