GteTextureArray.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
10 #include <Graphics/GteTexture.h>
11 
12 namespace gte
13 {
14 
16 {
17 protected:
18  // Abstract base class (shim). All items in the array have the same
19  // format, number of dimensions, dimension values, and mipmap status.
20  TextureArray(unsigned int numItems, DFType format,
21  unsigned int numDimensions, unsigned int dim0, unsigned int dim1,
22  unsigned int dim2, bool hasMipmaps, bool createStorage);
23 
24 public:
25  // Mipmap information.
26  inline unsigned int GetOffsetFor(unsigned int item, unsigned int level) const;
27  inline char const* GetDataFor(unsigned int item, unsigned int level) const;
28  inline char* GetDataFor(unsigned int item, unsigned int level);
29  template <typename T> inline T const* GetFor(unsigned int item, unsigned int level) const;
30  template <typename T> inline T* GetFor(unsigned int item, unsigned int level);
31 
32 public:
33  // For use by the Shader class for storing reflection information.
34  static int const shaderDataLookup = 5;
35 
36  // Used as face index in TextureCube and TextureCubeArray.
37  static const unsigned int CubeFacePositiveX = 0;
38  static const unsigned int CubeFaceNegativeX = 1;
39  static const unsigned int CubeFacePositiveY = 2;
40  static const unsigned int CubeFaceNegativeY = 3;
41  static const unsigned int CubeFacePositiveZ = 4;
42  static const unsigned int CubeFaceNegativeZ = 5;
43  static const unsigned int CubeFaceCount = 6;
44 };
45 
46 typedef std::function<void(std::shared_ptr<TextureArray> const&)> TextureArrayUpdater;
47 typedef std::function<void(std::shared_ptr<TextureArray> const&, unsigned int)> TextureArrayLevelUpdater;
48 
49 inline unsigned int TextureArray::GetOffsetFor(unsigned int item, unsigned int level) const
50 {
51  return Texture::GetOffsetFor(item, level);
52 }
53 
54 inline char const* TextureArray::GetDataFor(unsigned int item, unsigned int level) const
55 {
56  return Texture::GetDataFor(item, level);
57 }
58 
59 inline char* TextureArray::GetDataFor(unsigned int item, unsigned int level)
60 {
61  return Texture::GetDataFor(item, level);
62 }
63 
64 template <typename T> inline
65 T const* TextureArray::GetFor(unsigned int item, unsigned int level) const
66 {
67  return Texture::GetFor<T>(item, level);
68 }
69 
70 template <typename T> inline
71 T* TextureArray::GetFor(unsigned int item, unsigned int level)
72 {
73  return Texture::GetFor<T>(item, level);
74 }
75 
76 }
GLint level
Definition: glcorearb.h:103
char const * GetDataFor(unsigned int item, unsigned int level) const
char const * GetDataFor(unsigned int item, unsigned int level) const
Definition: GteTexture.h:147
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
std::function< void(std::shared_ptr< TextureArray > const &)> TextureArrayUpdater
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:103
unsigned int GetOffsetFor(unsigned int item, unsigned int level) const
T const * GetFor(unsigned int item, unsigned int level) const
std::function< void(std::shared_ptr< TextureArray > const &, unsigned int)> TextureArrayLevelUpdater
unsigned int GetOffsetFor(unsigned int item, unsigned int level) const
Definition: GteTexture.h:141
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:01