DI-Guy SDK Documentation  13.8
diguyOsgTextureBufferObject.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2024 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
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 resize(size_t sizeInBytes)
size_t mySizeInBytes
Definition: diguyOsgTextureBufferObject.h:42
diguyOsgTextureBufferObject(const unsigned char *pData, size_t sizeInBytes, GLenum format, GLenum usage)
GLenum format(void) const
Definition: diguyOsgTextureBufferObject.h:31
GLenum myFormat
Definition: diguyOsgTextureBufferObject.h:45
GLenum myUsage
Definition: diguyOsgTextureBufferObject.h:44
virtual ~diguyOsgTextureBufferObject()
void copyData(void *pData, size_t sizeInBytes, size_t offsetInBytes=0)
GLuint myTextureBufferObjectID
Definition: diguyOsgTextureBufferObject.h:40
size_t sizeInBytes(void) const
void reInitialize(const unsigned char *pData)
GLuint myTextureID
Definition: diguyOsgTextureBufferObject.h:41
Definition: diguyOsgTextureBufferObject.h:13