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