source: OGRE/trunk/ogrenew/OgreMain/src/OgreCompositionPass.cpp @ 692

Revision 692, 7.1 KB checked in by mattausch, 18 years ago (diff)

adding ogre 1.2 and dependencies

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#include "OgreStableHeaders.h"
26#include "OgreCompositionPass.h"
27#include "OgreMaterialManager.h"
28
29namespace Ogre {
30
31CompositionPass::CompositionPass(CompositionTargetPass *parent):
32    mParent(parent),
33    mType(PT_RENDERQUAD),
34        mIdentifier(0),
35        mFirstRenderQueue(RENDER_QUEUE_SKIES_EARLY),
36        mLastRenderQueue(RENDER_QUEUE_SKIES_LATE),
37    mClearBuffers(FBT_COLOUR|FBT_DEPTH),
38    mClearColour(0.0,0.0,0.0,0.0),
39        mClearDepth(1.0f),
40        mClearStencil(0),
41    mStencilCheck(false),
42    mStencilFunc(CMPF_ALWAYS_PASS),
43    mStencilRefValue(0),
44    mStencilMask(0xFFFFFFFF),
45    mStencilFailOp(SOP_KEEP),
46    mStencilDepthFailOp(SOP_KEEP),
47    mStencilPassOp(SOP_KEEP),
48    mStencilTwoSidedOperation(false)
49{
50}
51//-----------------------------------------------------------------------
52CompositionPass::~CompositionPass()
53{
54}
55//-----------------------------------------------------------------------
56void CompositionPass::setType(CompositionPass::PassType type)
57{
58    mType = type;
59}
60//-----------------------------------------------------------------------
61CompositionPass::PassType CompositionPass::getType() const
62{
63    return mType;
64}
65//-----------------------------------------------------------------------
66void CompositionPass::setIdentifier(uint32 id)
67{
68    mIdentifier = id;
69}
70//-----------------------------------------------------------------------
71uint32 CompositionPass::getIdentifier() const
72{
73    return mIdentifier;
74}
75//-----------------------------------------------------------------------
76void CompositionPass::setMaterial(MaterialPtr mat)
77{
78    mMaterial = mat;
79}
80//-----------------------------------------------------------------------
81void CompositionPass::setMaterialName(const String &name)
82{
83    mMaterial = MaterialManager::getSingleton().getByName(name);
84}
85//-----------------------------------------------------------------------
86MaterialPtr CompositionPass::getMaterial() const
87{
88    return mMaterial;
89}
90//-----------------------------------------------------------------------
91void CompositionPass::setClearBuffers(uint32 val)
92{
93    mClearBuffers = val;
94}
95//-----------------------------------------------------------------------
96uint32 CompositionPass::getClearBuffers()
97{
98    return mClearBuffers;
99}
100//-----------------------------------------------------------------------
101void CompositionPass::setClearColour(ColourValue val)
102{
103    mClearColour = val;
104}
105//-----------------------------------------------------------------------
106const ColourValue &CompositionPass::getClearColour()
107{
108    return mClearColour;
109}
110//-----------------------------------------------------------------------
111void CompositionPass::setInput(size_t id, const String &input)
112{
113    assert(id<OGRE_MAX_TEXTURE_LAYERS);
114    mInputs[id] = input;
115}
116//-----------------------------------------------------------------------
117const String &CompositionPass::getInput(size_t id)
118{
119    assert(id<OGRE_MAX_TEXTURE_LAYERS);
120    return mInputs[id];
121}
122//-----------------------------------------------------------------------
123size_t CompositionPass::getNumInputs()
124{
125    size_t count = 0;
126    for(size_t x=0; x<OGRE_MAX_TEXTURE_LAYERS; ++x)
127    {
128        if(!mInputs[x].empty())
129            count = x+1;
130    }
131    return count;
132}
133//-----------------------------------------------------------------------
134void CompositionPass::clearAllInputs()
135{
136    for(size_t x=0; x<OGRE_MAX_TEXTURE_LAYERS; ++x)
137    {
138        mInputs[x].clear();
139    }
140}
141//-----------------------------------------------------------------------
142CompositionTargetPass *CompositionPass::getParent()
143{
144    return mParent;
145}
146//-----------------------------------------------------------------------
147void CompositionPass::setFirstRenderQueue(uint8 id)
148{
149        mFirstRenderQueue = id;
150}
151//-----------------------------------------------------------------------
152uint8 CompositionPass::getFirstRenderQueue()
153{
154        return mFirstRenderQueue;
155}
156//-----------------------------------------------------------------------
157void CompositionPass::setLastRenderQueue(uint8 id)
158{
159        mLastRenderQueue = id;
160}
161//-----------------------------------------------------------------------
162uint8 CompositionPass::getLastRenderQueue()
163{
164        return mLastRenderQueue;
165}
166//-----------------------------------------------------------------------
167void CompositionPass::setClearDepth(Real depth)
168{
169        mClearDepth = depth;
170}
171Real CompositionPass::getClearDepth()
172{
173        return mClearDepth;
174}
175void CompositionPass::setClearStencil(uint32 value)
176{
177        mClearStencil = value;
178}
179uint32 CompositionPass::getClearStencil()
180{
181        return mClearStencil;
182}
183
184void CompositionPass::setStencilCheck(bool value)
185{
186        mStencilCheck = value;
187}
188bool CompositionPass::getStencilCheck()
189{
190        return mStencilCheck;
191}
192void CompositionPass::setStencilFunc(CompareFunction value)
193{
194        mStencilFunc = value;
195}
196CompareFunction CompositionPass::getStencilFunc()
197{
198        return mStencilFunc;
199}
200void CompositionPass::setStencilRefValue(uint32 value)
201{
202        mStencilRefValue = value;
203}
204uint32 CompositionPass::getStencilRefValue()
205{
206        return mStencilRefValue;
207}
208void CompositionPass::setStencilMask(uint32 value)
209{
210        mStencilMask = value;
211}
212uint32 CompositionPass::getStencilMask()
213{
214        return mStencilMask;
215}
216void CompositionPass::setStencilFailOp(StencilOperation value)
217{
218        mStencilFailOp = value;
219}
220StencilOperation CompositionPass::getStencilFailOp()
221{
222        return mStencilFailOp;
223}
224void CompositionPass::setStencilDepthFailOp(StencilOperation value)
225{
226        mStencilDepthFailOp = value;
227}
228StencilOperation CompositionPass::getStencilDepthFailOp()
229{
230        return mStencilDepthFailOp;
231}
232void CompositionPass::setStencilPassOp(StencilOperation value)
233{
234        mStencilPassOp = value;
235}
236StencilOperation CompositionPass::getStencilPassOp()
237{
238        return mStencilPassOp;
239}
240void CompositionPass::setStencilTwoSidedOperation(bool value)
241{
242        mStencilTwoSidedOperation = value;
243}
244bool CompositionPass::getStencilTwoSidedOperation()
245{
246        return mStencilTwoSidedOperation;
247}
248
249}
Note: See TracBrowser for help on using the repository browser.