Carna  Version 3.3.2
BaseBuffer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef BASEBUFFER_H_6014714286
13 #define BASEBUFFER_H_6014714286
14 
15 #include <cstdlib>
16 
21 namespace Carna
22 {
23 
24 namespace base
25 {
26 
27 
28 
29 // ----------------------------------------------------------------------------------
30 // BaseBuffer
31 // ----------------------------------------------------------------------------------
32 
39 class CARNA_LIB BaseBuffer
40 {
41 
42  std::size_t mySize;
43 
44 protected:
45 
49  bool valid;
50 
57  explicit BaseBuffer( unsigned int target );
58 
62  void setSize( std::size_t size );
63 
64 public:
65 
69  virtual ~BaseBuffer();
70 
74  const unsigned int target;
75 
79  const unsigned int id;
80 
84  std::size_t size() const;
85 
89  void bind() const;
90 
94  bool isValid() const;
95 
96 }; // BaseBuffer
97 
98 
99 
100 } // namespace Carna :: base
101 
102 } // namespace Carna
103 
104 #endif // BASEBUFFER_H_6014714286
const unsigned int target
Holds where the maintained buffer object is to be bound to by glBindBuffer.
Definition: BaseBuffer.h:74
const unsigned int id
Holds the ID of the maintained OpenGL buffer object.
Definition: BaseBuffer.h:79
Implements OpenGL buffer objects maintenance RAII base class.
Definition: BaseBuffer.h:39
bool valid
Flag that indicates whether the maintained OpenGL buffer object is valid.
Definition: BaseBuffer.h:49