VR-Forces 4.6 Class Documentation
 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 #include <GL/glew.h>
18 
19 namespace makVrv {
20 
21  class Device;
22 
26  {
27  public:
29  //ONLY SAFE IN THE DRAW THREAD
30  DtGlTextureBufferObject( const char * name, size_t sizeInBytes
31  , DtDataFormat format
32  , DtUsage usage
33  , DtCpuAccess cpuAccess);
34 
35  // doesn't allocate instantly
37  const char * name,
38  DtDataFormat format
39  , DtUsage usage
40  , DtCpuAccess cpuAccess
41  );
42 
43  void setName(const char * name) { myName = name; }
44 
46  virtual ~DtGlTextureBufferObject();
47 
49  size_t sizeInBytes(void) const;
50 
52  void copyData(void* pData, size_t sizeInBytes, size_t offsetInBytes = 0);
53 
55  void copyDataMapped(void* pData, size_t sizeInBytes, size_t offsetInBytes = 0);
56 
58  DtDataFormat format(void) const { return myFormat; }
59 
60  void bindTexture(void);
61  void bindTBO(void);
62  void* mapTBO(void);
63  void unmapTBO(void);
64 
66  void resize(size_t sizeInBytes);
67 
68  void tearDown(void);
69  void setUseBufferedData(bool val) { myUseBufferData = val; }
70  bool getUseBufferedData() { return myUseBufferData; }
71 
72  private:
73  std::string myName;
75  GLuint myTextureID;
76  size_t mySizeInBytes;
77 
81 
82  GLenum myGLUsage;
84 
86  char * myBufferData;
87 
88  void reInitialize(const byte* pData);
89  };
90 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)