HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_TextureCubeMap.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Render Library (C++)
7  *
8  * COMMENTS:
9  * Handle to a cube texture map stored in the texture cache. This class is
10  * primarily responsible for fetching images from various 2D sources and
11  * creating the texture for them.
12  */
13 
14 #ifndef __RE_TextureCubeMap_h__
15 #define __RE_TextureCubeMap_h__
16 
17 #include "RE_API.h"
18 #include "RE_TextureMap.h"
19 #include <UT/UT_UniquePtr.h>
20 
21 class IMG_File;
22 class PXL_Raster;
23 
25 {
26 public:
28  ~RE_TextureCubeMap() override;
29 
30  /// Returns the amount of main memory (NOT graphics memory!)
31  /// owned by this RE_TextureCubeMap.
32  int64 getMemoryUsage(bool inclusive) const override;
33 
35  RE_TextureMap *clone() const override;
36 
37  // Public interface is in RE_TextureMap
38 private:
39  bool buildTexture(RE_Render *r, RE_Texture *tex,
40  void *data) override;
41  bool getNodeSource(const char *map, const char *rel,
42  void **mapptr,
43  RE_TextureDimension &textype,
44  RE_GPUType &datatype,
45  int &vectorsize,
46  int &w, int &h, int &d) override;
47  bool getFileSource(const char *map,
48  void **mapptr,
49  RE_TextureDimension &textype,
50  RE_GPUType &datatype,
51  int &vectorsize,
52  int &w, int &h, int &d,
53  bool preload) override;
54  void buildTextureName(UT_String &, const char *map,
55  const char *rel) override;
56 
57  bool loadCubeMap(IMG_File *fp, int w, int h,
58  RE_GPUType dt, int vs, void **mapptr);
59  bool loadSphereMap(IMG_File *fp,int w, int h, int sw, int sh,
60  RE_GPUType dt, int vs, void **mapptr);
61  void generateMipMaps(RE_Render *r, RE_Texture *tex);
63  const PXL_Raster *src,
64  bool wrap_y);
65 
66  float myOpTime;
67 
68  UT_UniquePtr<PXL_Raster> myPolarMap;
69  enum PolarType
70  {
71  LatLongStyle, // aspect 2:1
72  MatCapStyle // aspect 1:1
73  };
74  PolarType myPolarType;
75 };
76 
77 #endif
RE_API bool loadCubeMap(IMG_File *fp, int w, int h, RE_GPUType type, int vsize, void *output_pixels)
virtual RE_TextureMap * clone() const =0
#define RE_API
Definition: RE_API.h:10
RE_TextureDimension getMapType() override
virtual bool getNodeSource(const char *map, const char *rel, void **mapptr, RE_TextureDimension &textype, RE_GPUType &datatype, int &vectorsize, int &w, int &h, int &d)
RE_TextureDimension
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
RE_GPUType
Definition: RE_Types.h:44
long long int64
Definition: SYS_Types.h:116
virtual void buildTextureName(UT_String &cachedname, const char *map, const char *rel)
virtual int64 getMemoryUsage(bool inclusive) const
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
virtual bool getFileSource(const char *map, void **mapptr, RE_TextureDimension &textype, RE_GPUType &datatype, int &vectorsize, int &w, int &h, int &d, bool preload_only)
RE_API void scalePolarFromRaster(PXL_Raster *dest, const PXL_Raster *src, bool wrap_y)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
GLboolean r
Definition: glcorearb.h:1222
virtual bool buildTexture(RE_Render *r, RE_Texture *tex, void *data)=0
Definition: format.h:895
GLenum src
Definition: glcorearb.h:1793