CrystalSpace

Public API Reference

csplugincommon/rendermanager/shadow_common.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008 by Frank Richter
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_CSPLUGINCOMMON_RENDERMANAGER_SHADOW_COMMON_H__
00020 #define __CS_CSPLUGINCOMMON_RENDERMANAGER_SHADOW_COMMON_H__
00021 
00026 #include "ivideo/graph3d.h"
00027 #include "ivideo/shader/shader.h"
00028 
00029 #include "csplugincommon/rendermanager/texturecache.h"
00030 #include "csutil/customallocated.h"
00031 #include "csutil/parray.h"
00032 
00033 namespace CS
00034 {
00035   namespace RenderManager
00036   {
00037     class PostEffectManager;
00038   
00040     class CS_CRYSTALSPACE_EXPORT ShadowSettings
00041     {
00042     public:
00044       struct Target : public CS::Memory::CustomAllocated
00045       {
00047         csRenderTargetAttachment attachment;
00049         CS::ShaderVarStringID svName;
00051         TextureCache texCache;
00052         
00053         Target (csRenderTargetAttachment attachment,
00054           CS::ShaderVarStringID svName,
00055           const char* format, uint texFlags)
00056           : attachment (attachment), svName (svName),
00057             texCache (csimg2D, format, 
00058               CS_TEXTURE_3D | CS_TEXTURE_CLAMP | texFlags,
00059               "shadowmap", 
00060               TextureCache::tcachePowerOfTwo | TextureCache::tcacheExactSizeMatch)
00061           {}
00062       };
00063       typedef csPDelArray<Target> TargetArray;
00064       
00066       TargetArray targets;
00068       csRef<iShader> shadowDefaultShader;
00070       csStringID shadowShaderType;
00072       bool provideIDs;
00074       CS::ShaderVarStringID svMeshIDName;
00075       
00077       csRef<PostEffectManager> postEffects;
00078       
00085       void ReadSettings (iObjectRegistry* objReg, const char* shadowType);
00091       void AdvanceFrame (csTicks time);
00092     protected:
00093       bool ReadTargets (TargetArray& targets, iConfigFile* cfg,
00094         const char* prefixed, iShaderVarStringSet* svStrings, 
00095         iObjectRegistry* objReg);
00096     };
00097   } // namespace RenderManager
00098 } // namespace CS
00099 
00100 #endif // __CS_CSPLUGINCOMMON_RENDERMANAGER_SHADOW_COMMON_H__

Generated for Crystal Space 2.0 by doxygen 1.7.6.1