Torque3D Documentation / _generateds / gfxD3D11Cubemap.h

gfxD3D11Cubemap.h

Engine/source/gfx/D3D11/gfxD3D11Cubemap.h

More...

Classes:

Public Variables

Detailed Description

Public Variables

const U32 CubeFaces 
 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2015 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef _GFXD3D11CUBEMAP_H_
25#define _GFXD3D11CUBEMAP_H_
26
27#include "gfx/D3D11/gfxD3D11Device.h"
28#include "gfx/gfxCubemap.h"
29#include "gfx/gfxResource.h"
30#include "gfx/gfxTarget.h"
31
32const U32 CubeFaces = 6;
33
34class GFXD3D11Cubemap : public GFXCubemap
35{
36public:
37   virtual void initStatic( GFXTexHandle *faces );
38   virtual void initStatic( DDSFile *dds );
39   virtual void initDynamic( U32 texSize, GFXFormat faceFormat = GFXFormatR8G8B8A8 );
40   virtual void setToTexUnit( U32 tuNum );
41   virtual U32 getSize() const { return mTexSize; }
42   virtual GFXFormat getFormat() const { return mFaceFormat; }
43
44   GFXD3D11Cubemap();
45   virtual ~GFXD3D11Cubemap();
46
47   // GFXResource interface
48   virtual void zombify();
49   virtual void resurrect();
50
51   // Get functions
52   ID3D11ShaderResourceView* getSRView();
53   ID3D11RenderTargetView* getRTView(U32 faceIdx);
54   ID3D11RenderTargetView** getRTViewArray();
55   ID3D11DepthStencilView* getDSView();
56   ID3D11Texture2D* get2DTex();
57
58private:
59
60   friend class GFXD3D11TextureTarget;
61   friend class GFXD3D11Device;
62
63   ID3D11Texture2D* mTexture;
64   ID3D11ShaderResourceView* mSRView; // for shader resource input
65   ID3D11RenderTargetView* mRTView[CubeFaces]; // for render targets, 6 faces of the cubemap
66   ID3D11DepthStencilView* mDSView; //render target view for depth stencil
67
68   bool mAutoGenMips;
69   bool mDynamic;
70   U32  mTexSize;
71   GFXFormat mFaceFormat;
72   
73   void releaseSurfaces();
74
75   bool isCompressed(GFXFormat format);
76   /// The callback used to get texture events.
77   /// @see GFXTextureManager::addEventDelegate
78   void _onTextureEvent(GFXTexCallbackCode code);
79};
80
81#endif
82