VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlBuffer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <string>
12 
17 
18 namespace makVrv
19 {
26  {
27  public:
34  DtGlBuffer(const char * name, DtBufferType type, DtUsage usage, DtCpuAccess accessType, bool hasStagingBuffer);
35 
37  virtual ~DtGlBuffer();
38 
39  private:
41  DtGlBuffer(const DtGlBuffer &other);
43  DtGlBuffer &operator=(const DtGlBuffer &other);
44 
45  public:
46 
48  virtual void tearDown(void);
49 
51  unsigned int releaseHandle(void);
52 
56  virtual bool updateBuffer(const int sizeToTransferInBytes, const void* data);
57 
61  virtual void clearBuffer(unsigned int clearValue);
62 
64  virtual void bind();
68  virtual void unbind();
70 
71 
73  virtual unsigned char* stagingBuffer(void) const;
79 
82  virtual unsigned char* stagingBufferWithSize(unsigned int requestedSizeInBytes);
83 
86  virtual void syncStagingBufferToGpu(unsigned int offset, unsigned int sizeInBytes);
87 
90  virtual void syncStagingBufferToGpu();
92 
97  virtual bool bufferSubData(unsigned int offset, unsigned int sizeInBytes, const void *data);
98 
99 
101  virtual void resetStagingBuffer();
102 
104  virtual int sizeInBytes(void) const;
105 
107  virtual const unsigned int handle(void) const;
108 
110  virtual void setResizeMultiplier(float rmul);
111 
116  virtual void setUseIncrementalUpdate(bool incrementalUpdate);
117 
119  virtual bool useIncrementalUpdate();
120 
122  virtual float resizeMultiplier();
123 
125  unsigned int type(void) const;
126 
127  protected:
128 
131  virtual bool createAndBindBuffer();
132 
135  virtual int calculateNewSize(int requestedNewSizeInBytes);
136 
137  protected:
138 
139  std::string myName;
140  unsigned int myHandle;
141  unsigned int myType;
144  unsigned char* myStagingBuffer;
148 
151  };
152 
153 }
int myLastBufferTransferOffset
Definition: DtGlBuffer.h:150
Dll export defines.
DtUsage myUsage
Definition: DtGlBuffer.h:146
DtBufferType
An abstract buffer type (vertex buffer, index buffer, etc) Used, for example, to create DtGlBuffers o...
Definition: DtBufferType.h:15
int mySizeInBytes
Definition: DtGlBuffer.h:142
DtCpuAccess myAccessType
Definition: DtGlBuffer.h:147
std::string myName
Definition: DtGlBuffer.h:139
Buffer Usage enums.
DtUsage
Definition: DtUsage.h:13
Enumerations for cpu access required by textures/buffers.
unsigned int myHandle
Definition: DtGlBuffer.h:140
unsigned int myType
Definition: DtGlBuffer.h:141
binderNoArgs< _Fn > bind(const _Fn &_Func, const _Ty &_Left)
Definition: DtSTLUtilities.h:76
bool myUseIncrementalUpdate
Definition: DtGlBuffer.h:149
unsigned char * myStagingBuffer
Definition: DtGlBuffer.h:144
bool myHasStagingBuffer
Definition: DtGlBuffer.h:145
A generic OpenGL buffer.
Definition: DtGlBuffer.h:25
Buffer Type enums.
#define DT_DLL_VRVGRAPHICSUTILS
Definition: vrvGraphicsUtils.h:18
voidpf uLong offset
Definition: ioapi.h:42
DtCpuAccess
Definition: DtCpuAccess.h:13
float myResizeMultiplier
Definition: DtGlBuffer.h:143

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)