Torque3D Documentation / _generateds / gfxStateBlockData.h

gfxStateBlockData.h

Engine/source/gfx/sim/gfxStateBlockData.h

More...

Classes:

class

Allows definition of sampler state via script, basically wraps a GFXSamplerStateDesc.

class

Allows definition of render state via script, basically wraps a GFXStateBlockDesc.

Detailed Description

 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#ifndef __GFXSTATEBLOCKDATA_H_
24#define __GFXSTATEBLOCKDATA_H_
25
26#ifndef _GFXSTATEBLOCK_H_
27#include "gfx/gfxStateBlock.h"
28#endif
29#ifndef _SIMOBJECT_H_
30#include "console/simObject.h"
31#endif
32
33
34class GFXSamplerStateData;
35
36/// Allows definition of render state via script, basically wraps a GFXStateBlockDesc
37class GFXStateBlockData : public SimObject
38{
39   typedef SimObject Parent;
40
41   GFXStateBlockDesc mState;
42   GFXSamplerStateData* mSamplerStates[GFX_TEXTURE_STAGE_COUNT];
43public:
44   GFXStateBlockData();
45
46   // SimObject
47   virtual bool onAdd();
48   static void initPersistFields();  
49
50   // GFXStateBlockData
51   const GFXStateBlockDesc getState() const { return mState; }
52        
53   DECLARE_CONOBJECT(GFXStateBlockData);   
54};
55
56/// Allows definition of sampler state via script, basically wraps a GFXSamplerStateDesc
57class GFXSamplerStateData : public SimObject
58{
59   typedef SimObject Parent;
60   GFXSamplerStateDesc mState;
61public:
62   // SimObject
63   static void initPersistFields();  
64
65   /// Copies the data of this object into desc
66   void setSamplerState(GFXSamplerStateDesc& desc);
67
68   DECLARE_CONOBJECT(GFXSamplerStateData);
69};
70
71
72#endif // __GFXSTATEBLOCKDATA_H_
73