HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GT_DASubArray.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GT_DASubArray.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_DASubArray__
12 #define __GT_DASubArray__
13 
14 #include "GT_API.h"
15 #include "GT_DAInherit.h"
16 
17 /// @brief A slice of a different data array
19 public:
20  /// Default constructor
22  : mySize(0)
23  , myStart(0)
24  , GT_DAInherit()
25  {
26  }
27  /// Useful constructor
29  : mySize(size)
30  , myStart(start)
31  , GT_DAInherit(data)
32  {
33  }
34  /// Copy constructor
36  : mySize(src.mySize)
37  , myStart(src.myStart)
38  , GT_DAInherit(src)
39  {
40  }
41  /// Destructor
42  virtual ~GT_DASubArray();
43 
44  virtual const char *className() const { return "GT_DASubArray"; }
45 
46  /// Initialize with given data
49  {
50  GT_DAInherit::init(data);
51  myStart = start;
52  mySize = size;
53  }
54 
55  GT_IMPL_INHERIT_ARRAY(getIndirect, mySize)
56 
57 private:
58  /// Map the requested offset to the offset in my data
59  inline GT_Offset getIndirect(GT_Offset offset) const
60  { return myStart + offset; }
61 
62  GT_Offset myStart;
63  GT_Size mySize;
64 };
65 
66 #endif
GT_DASubArray(const GT_DataArrayHandle &data, GT_Offset start, GT_Size size)
Useful constructor.
Definition: GT_DASubArray.h:28
GLuint start
Definition: glcorearb.h:474
void init(const GT_DataArrayHandle &data, GT_Offset start, GT_Size size)
Initialize with given data.
Definition: GT_DASubArray.h:47
#define GT_API
Definition: GT_API.h:11
GT_DASubArray(const GT_DASubArray &src)
Copy constructor.
Definition: GT_DASubArray.h:35
GLsizeiptr size
Definition: glcorearb.h:663
GLintptr offset
Definition: glcorearb.h:664
virtual const char * className() const
Definition: GT_DASubArray.h:44
GLboolean * data
Definition: glcorearb.h:130
GT_DASubArray()
Default constructor.
Definition: GT_DASubArray.h:21
A slice of a different data array.
Definition: GT_DASubArray.h:18
Base class for a data array which references another data array.
Definition: GT_DAInherit.h:18
#define GT_IMPL_INHERIT_ARRAY(MAP_INDEX, SIZE)
Definition: GT_DAInherit.h:71
void init(const GT_DataArrayHandle &data)
Definition: GT_DAInherit.h:32
int64 GT_Offset
Definition: GT_Types.h:110
int64 GT_Size
Definition: GT_Types.h:109
GLenum src
Definition: glcorearb.h:1792