- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDEffectPass.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008
    00014 #ifndef _FCD_EFFECT_PASS_H_
    00015 #define _FCD_EFFECT_PASS_H_
    00016
    00017 #ifndef __FCD_OBJECT_H_
    00018 #include "FCDocument/FCDObject.h"
    00019 #endif // __FCD_OBJECT_H_
    00020 #ifndef _FU_DAE_ENUM_H_
    00021 #include "FUtils/FUDaeEnum.h"
    00022 #endif // _FU_DAE_ENUM_H_
    00023
    00024 class FCDEffectTechnique;
    00025 class FCDEffectParameter;
    00026 class FCDEffectPassShader;
    00027 class FCDEffectPassState;
    00028
    00042 class FCOLLADA_EXPORT FCDEffectPass : public FCDObject
    00043 {
    00044 private:
    00045     DeclareObjectType(FCDObject);
    00046
    00047     FCDEffectTechnique* parent;
    00048     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, name, FC("Name"));
    00049     DeclareParameterContainer(FCDEffectPassShader, shaders, FC("Shaders"));
    00050     DeclareParameterContainer(FCDEffectPassState, states, FC("Render States"));
    00051
    00052 public:
    00057     FCDEffectPass(FCDocument* document, FCDEffectTechnique* parent);
    00058
    00060     virtual ~FCDEffectPass();
    00061
    00064     inline FCDEffectTechnique* GetParent() { return parent; }
    00065     inline const FCDEffectTechnique* GetParent() const { return parent; }
    00070     DEPRECATED(3.05A, GetParent()->GetParent()->GetParent()->GetDaeId()) const fm::string& GetDaeId() const { return emptyString; }
    00071
    00075     inline const fstring& GetPassName() const { return name; }
    00076
    00080     inline void SetPassName(const fchar* _name) { name = _name; SetDirtyFlag(); }
    00081
    00084     inline size_t GetShaderCount() const { return shaders.size(); }
    00085
    00089     inline FCDEffectPassShader* GetShader(size_t index) { FUAssert(index < GetShaderCount(), return NULL); return shaders.at(index); }
    00090     inline const FCDEffectPassShader* GetShader(size_t index) const { FUAssert(index < GetShaderCount(), return NULL); return shaders.at(index); }
    00094     FCDEffectPassShader* AddShader();
    00095
    00098     DEPRECATED(3.05A, shader->Release()) void ReleaseShader(FCDEffectPassShader* shader) { ((FCDObject*)shader)->Release(); }
    00099
    00103     inline FCDEffectPassShader* GetVertexShader() { return const_cast<FCDEffectPassShader*>(const_cast<const FCDEffectPass*>(this)->GetVertexShader()); }
    00104     const FCDEffectPassShader* GetVertexShader() const;
    00109     inline FCDEffectPassShader* GetFragmentShader() { return const_cast<FCDEffectPassShader*>(const_cast<const FCDEffectPass*>(this)->GetFragmentShader()); }
    00110     const FCDEffectPassShader* GetFragmentShader() const;
    00115     FCDEffectPassShader* AddVertexShader();
    00116
    00120     FCDEffectPassShader* AddFragmentShader();
    00121
    00124     DEPRECATED(3.05A, GetRenderStateCount and GetRenderState(index)) void GetRenderStates() const {}
    00125
    00128     inline size_t GetRenderStateCount() const { return states.size(); }
    00129
    00133     inline FCDEffectPassState* GetRenderState(size_t index) { FUAssert(index < states.size(), return NULL); return states.at(index); }
    00134     inline const FCDEffectPassState* GetRenderState(size_t index) const { FUAssert(index < states.size(), return NULL); return states.at(index); }
    00142     FCDEffectPassState* AddRenderState(FUDaePassState::State type);
    00143
    00148     inline FCDEffectPassState* FindRenderState(FUDaePassState::State type) { return const_cast<FCDEffectPassState*>(const_cast<const FCDEffectPass*>(this)->FindRenderState(type)); }
    00149     const FCDEffectPassState* FindRenderState(FUDaePassState::State type) const;
    00156     FCDEffectPass* Clone(FCDEffectPass* clone = NULL) const;
    00157 };
    00158
    00159 #endif