DI-Guy SDK Documentation  13.1
diguyOsgTextureBufferObject.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 #ifndef diguyOsgTextureBufferObject_h__
6 #define diguyOsgTextureBufferObject_h__
7 
8 #include <GL/glew.h>
9 
11 {
12 public:
13  diguyOsgTextureBufferObject(const unsigned char* pData, size_t sizeInBytes,
14  GLenum format,
15  GLenum usage
16  );
17 
19 
20  // Size in bytes of the texture buffer object
21  size_t sizeInBytes(void) const;
22 
23  // Upload data to the buffer. size <= size of buffer
24  // void copyData(void* pData, size_t sizeInBytes, size_t offsetInBytes);
25  void copyData(void* pData, size_t sizeInBytes, size_t offsetInBytes = 0);
26 
27  // Format of the texture
28  GLenum format(void) const {return myFormat;}
29 
30  void bindTexture(void);
31  void bindTBO(void);
32 
33  // Resize the tbo to a new size
34  void resize(size_t sizeInBytes);
35 
36 private:
38  GLuint myTextureID;
39  size_t mySizeInBytes;
40 
41  GLenum myUsage;
42  GLenum myFormat;
43 
44  void tearDown(void);
45  void reInitialize(const unsigned char* pData);
46 };
47 
48 #endif // diguyOsgTextureBufferObject_h__
void tearDown(void)
Definition: diguyOsgTextureBufferObject.cpp:10
void resize(size_t sizeInBytes)
Definition: diguyOsgTextureBufferObject.cpp:71
size_t mySizeInBytes
Definition: diguyOsgTextureBufferObject.h:39
virtual ~diguyOsgTextureBufferObject()
Definition: diguyOsgTextureBufferObject.cpp:43
diguyOsgTextureBufferObject(const unsigned char *pData, size_t sizeInBytes, GLenum format, GLenum usage)
Definition: diguyOsgTextureBufferObject.cpp:31
GLenum format(void) const
Definition: diguyOsgTextureBufferObject.h:28
GLenum myFormat
Definition: diguyOsgTextureBufferObject.h:42
GLenum myUsage
Definition: diguyOsgTextureBufferObject.h:41
void bindTBO(void)
Definition: diguyOsgTextureBufferObject.cpp:53
void copyData(void *pData, size_t sizeInBytes, size_t offsetInBytes=0)
Definition: diguyOsgTextureBufferObject.cpp:58
GLuint myTextureBufferObjectID
Definition: diguyOsgTextureBufferObject.h:37
size_t sizeInBytes(void) const
Definition: diguyOsgTextureBufferObject.cpp:66
void bindTexture(void)
Definition: diguyOsgTextureBufferObject.cpp:48
void reInitialize(const unsigned char *pData)
Definition: diguyOsgTextureBufferObject.cpp:15
GLuint myTextureID
Definition: diguyOsgTextureBufferObject.h:38
Definition: diguyOsgTextureBufferObject.h:10