VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlTexture.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 
24  {
25  // 1D texture, used in combination with 1D texture coordinates
27  // 2D texture, used in combination with 2D texture coordinates (default)
29  // 3D volume texture, used in combination with 3D texture coordinates
31  // 3D cube map, used in combination with 3D texture coordinates
33  // 2D texture array
35  };
36 
40  {
41  public:
43  DtGlTexture(const char * name, const byte* pData, size_t byteLength);
44 
46  DtGlTexture(const char * name, TextureType type
47  , size_t width, size_t height, size_t depth
48  , DtDataFormat format
49  , const DtUsage usage, const DtCpuAccess cpuAccess, const int bindFlags
50  , void* pData);
51 
54  , size_t externalRefTexID
55  , size_t width = 1, size_t height = 1, size_t depth = 1);
56 
57  void setName(const char * name) { myName = name; }
58 
60  virtual ~DtGlTexture();
61 
63  DtDataFormat format(void) const;
64 
66  size_t sizeInBytes(void) const;
67 
69  size_t width(void) const;
71  size_t height(void) const;
73  size_t depth(void) const;
74 
76  void copyData(void* pData);
77 
80  void copyData(void* pData, size_t width, size_t height, size_t depth);
81 
82  void bindTexture(void);
83 
84  void setExternalTextureReference(size_t externalRefTexID);
85 
86  size_t textureReference() const;
87 
88  void releaseGLObjects() const;
89 
90  private:
91  std::string myName;
92  mutable GLuint myTextureID;
94 
95  bool is1D(void) const;
96  bool is2D(void) const;
97  bool is3D(void) const;
98 
99  size_t myWidth;
100  size_t myHeight;
101  size_t myDepth;
104  };
105 }

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)