hx3d  1
2D/3D Simple Game Framework
attribute_array_buffer.hpp
1 /*
2  Attribute array buffer.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef HX3D_GRAPHICS_BUFFERS_ATTRIBUTEARRAYBUFFER
22 #define HX3D_GRAPHICS_BUFFERS_ATTRIBUTEARRAYBUFFER
23 
24 #include "hx3d/graphics/buffers/array_buffer.hpp"
25 #include "hx3d/graphics/buffers/attribute.hpp"
26 
27 namespace hx3d {
28 namespace graphics {
29 namespace buffers {
30 
34 class AttributeArrayBuffer: public ArrayBuffer<float> {
35 
36 public:
43 
49  AttributeArrayBuffer(const Attribute attribute);
50 
57  AttributeArrayBuffer(const Attribute attribute, const std::vector<float> values);
59 
65  void create(const Attribute attribute);
66 
73 
74  virtual void upload() override;
75 
76  virtual void begin(const Ptr<Shader>& shader) override;
77  virtual void end(const Ptr<Shader>& shader) override;
78 
79 protected:
82 };
83 
84 } /* buffers */
85 } /* graphics */
86 } /* hx3d */
87 
88 #endif
virtual void begin(const Ptr< Shader > &shader) override
Begin the use with a shader.
void create(const Attribute attribute)
Initialize the attribute array buffer.
virtual void end(const Ptr< Shader > &shader) override
End the use with a shader.
hx3d framework namespace
Definition: audio.hpp:26
OpenGL buffer attribute.
Definition: attribute.hpp:35
virtual void upload() override
Upload the data to the GPU.
AttributeArrayBuffer()
Construct an empty attribute array buffer.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition: ptr.hpp:34
OpenGL GPU uploadable buffer.