VolumetricFogRTManager.h
Engine/source/environment/VolumetricFogRTManager.h
Classes:
Public Defines
define
VFRTM() ()
Public Typedefs
Signal< void(VolumetricFogRTManager *VolumetricFogRTManager, bool resize)>
VolumetricFogRTMResizeSignal
Public Variables
Detailed Description
Public Defines
VFRTM() ()
Public Typedefs
typedef Signal< void(VolumetricFogRTManager *VolumetricFogRTManager, bool resize)> VolumetricFogRTMResizeSignal
Public Variables
VolumetricFogRTManager * gVolumetricFogRTManager
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 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 _VolumetricFogRTManager_H_ 25#define _VolumetricFogRTManager_H_ 26 27#ifndef _SCENEOBJECT_H_ 28#include "scene/sceneObject.h" 29#endif 30#ifndef _MATTEXTURETARGET_H_ 31#include "materials/matTextureTarget.h" 32#endif 33#ifndef _GFXTARGET_H_ 34#include "gfx/gfxTarget.h" 35#endif 36#ifndef _SIGNAL_H_ 37#include "core/util/tSignal.h" 38#endif 39 40class VolumetricFogRTManager; 41 42typedef Signal<void(VolumetricFogRTManager *VolumetricFogRTManager, bool resize)> VolumetricFogRTMResizeSignal; 43 44#define VFRTM VolumetricFogRTManager::get() 45 46class VolumetricFogRTManager : public SceneObject 47{ 48 public: 49 typedef SceneObject Parent; 50 51 protected: 52 GFXTexHandle mDepthBuffer; 53 GFXTexHandle mFrontBuffer; 54 55 NamedTexTarget mDepthTarget; 56 NamedTexTarget mFrontTarget; 57 58 PlatformWindow* mPlatformWindow; 59 60 static S32 mTargetScale; 61 bool mIsInitialized; 62 U32 mNumFogObjects; 63 U32 mWidth; 64 U32 mHeight; 65 66 void onRemove(); 67 void onSceneRemove(); 68 void ResizeRT(WindowId did, S32 width, S32 height); 69 70 static VolumetricFogRTMResizeSignal smVolumetricFogRTMResizeSignal; 71 72 public: 73 VolumetricFogRTManager(); 74 ~VolumetricFogRTManager(); 75 static VolumetricFogRTManager *get(); 76 bool Init(); 77 bool IsInitialized() { return mIsInitialized; } 78 static void consoleInit(); 79 static VolumetricFogRTMResizeSignal& getVolumetricFogRTMResizeSignal() { return smVolumetricFogRTMResizeSignal; } 80 void FogAnswered(); 81 S32 setQuality(U32 Quality); 82 bool Resize(); 83 U32 IncFogObjects(); 84 U32 DecFogObjects(); 85 86 DECLARE_CONOBJECT(VolumetricFogRTManager); 87}; 88 89extern VolumetricFogRTManager* gVolumetricFogRTManager; 90 91#endif 92