VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlTextureBufferObject.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
16 
17 typedef unsigned int GLuint;
18 typedef unsigned int GLenum;
19 
20 
21 namespace makVrv {
22 
23  class Device;
24 
28  {
29  public:
31  //ONLY SAFE IN THE DRAW THREAD
32  DtGlTextureBufferObject( const char * name, size_t sizeInBytes
33  , DtDataFormat format
34  , DtUsage usage
35  , DtCpuAccess cpuAccess);
36 
37  // doesn't allocate instantly
39  const char * name,
40  DtDataFormat format
41  , DtUsage usage
42  , DtCpuAccess cpuAccess
43  );
44 
45  void setName(const char * name) { myName = name; }
46 
48  virtual ~DtGlTextureBufferObject();
49 
51  size_t sizeInBytes(void) const;
52 
54  void copyData(void* pData, size_t sizeInBytes, size_t offsetInBytes = 0);
55 
57  void copyAndOrphanStreamedData(void* pData, size_t sizeInBytes);
58 
60  void copyDataMapped(void* pData, size_t sizeInBytes, size_t offsetInBytes = 0);
61 
63  DtDataFormat format(void) const { return myFormat; }
64 
65  void bindTexture(void);
66  void bindTBO(void);
67  void* mapTBO(void);
68  void unmapTBO(void);
69 
71  void resize(size_t sizeInBytes);
72 
73  void tearDown(void);
74  void setUseBufferedData(bool val) { myUseBufferData = val; }
75  bool getUseBufferedData() { return myUseBufferData; }
76 
77  private:
78  std::string myName;
81  size_t mySizeInBytes;
82 
88 
90  char * myBufferData;
91 
92  void reInitialize(const byte* pData);
93  };
94 }
Wrapper for OpenGL Texture Buffer Object.
Definition: DtGlTextureBufferObject.h:27
size_t mySizeInBytes
Definition: DtGlTextureBufferObject.h:81
void setName(const char *name)
Definition: DtGlTextureBufferObject.h:45
Dll export defines.
void setUseBufferedData(bool val)
Definition: DtGlTextureBufferObject.h:74
bool getUseBufferedData()
Definition: DtGlTextureBufferObject.h:75
GLuint myTextureBufferObjectID
Definition: DtGlTextureBufferObject.h:79
DtDataFormat myFormat
Definition: DtGlTextureBufferObject.h:85
DtCpuAccess myCPUAccess
Definition: DtGlTextureBufferObject.h:84
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
Buffer Usage enums.
DtUsage
Definition: DtUsage.h:13
unsigned char byte
Definition: DtCommonTypes.h:36
std::string myName
Definition: DtGlTextureBufferObject.h:78
Enumerations for cpu access required by textures/buffers.
DtUsage myUsage
Definition: DtGlTextureBufferObject.h:83
GLenum myGLInternalFormat
Definition: DtGlTextureBufferObject.h:87
DtDataFormat format(void) const
Format of the texture.
Definition: DtGlTextureBufferObject.h:63
unsigned int GLenum
Definition: DtGlTextureBufferObject.h:18
Enumerations for various types of texture/buffer formats.
char * myBufferData
Definition: DtGlTextureBufferObject.h:90
bool myUseBufferData
Definition: DtGlTextureBufferObject.h:89
DtDataFormat
Definition: DtDataFormat.h:15
#define DT_DLL_VRVGRAPHICSUTILS
Definition: vrvGraphicsUtils.h:18
GLuint myTextureID
Definition: DtGlTextureBufferObject.h:80
DtCpuAccess
Definition: DtCpuAccess.h:13
GLenum myGLUsage
Definition: DtGlTextureBufferObject.h:86

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)