NGL  6.5
The NCCA Graphics Library
SimpleVAO.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 SIMPLEVAO_H_
18 #define SIMPLEVAO_H_
19 
20 #include "AbstractVAO.h"
21 
22 namespace ngl
23 {
24 //----------------------------------------------------------------------------------------------------------------------
32 //----------------------------------------------------------------------------------------------------------------------
33 
35 {
36  public :
37  //----------------------------------------------------------------------------------------------------------------------
41  //----------------------------------------------------------------------------------------------------------------------
42  static AbstractVAO *create(GLenum _mode=GL_TRIANGLES) { return new SimpleVAO(_mode); }
43  //----------------------------------------------------------------------------------------------------------------------
45  //----------------------------------------------------------------------------------------------------------------------
46  virtual void draw() const;
47  //----------------------------------------------------------------------------------------------------------------------
49  //----------------------------------------------------------------------------------------------------------------------
50  virtual ~SimpleVAO();
51  //----------------------------------------------------------------------------------------------------------------------
53  //----------------------------------------------------------------------------------------------------------------------
54  virtual void removeVAO();
55  //----------------------------------------------------------------------------------------------------------------------
58  //----------------------------------------------------------------------------------------------------------------------
59  virtual void setData(const VertexData &_data);
60  //----------------------------------------------------------------------------------------------------------------------
64  //----------------------------------------------------------------------------------------------------------------------
65  GLuint getBufferID(unsigned int ){return m_buffer;}
66 
67  protected :
68  //----------------------------------------------------------------------------------------------------------------------
70  //----------------------------------------------------------------------------------------------------------------------
71  SimpleVAO(GLenum _mode) : AbstractVAO(_mode)
72  {
73 
74  }
75 
76  private :
77  //----------------------------------------------------------------------------------------------------------------------
79  //----------------------------------------------------------------------------------------------------------------------
80  GLuint m_buffer=0;
81 
82 };
83 
84 
85 } // end namespace
86 
87 #endif
unsigned int GLuint
Definition: glew.h:280
#define NGL_DLLEXPORT
Definition: Types.h:65
#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
static AbstractVAO * create(GLenum _mode=GL_TRIANGLES)
creator method for the factory
Definition: SimpleVAO.h:42
Simple non index vao using one buffer and float data see https://github.com/NCCA/VertexArrayObject/tr...
Definition: SimpleVAO.h:34
SimpleVAO(GLenum _mode)
ctor calles parent ctor to allocate vao;
Definition: SimpleVAO.h:71
GLuint getBufferID(unsigned int)
return the id of the buffer, if there is only 1 buffer just return this if we have the more than one ...
Definition: SimpleVAO.h:65