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

- File List
- File Members

# FCDocument/FCDEffectPassShader.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_SHADER_H_
    00015 #define _FCD_EFFECT_PASS_SHADER_H_
    00016
    00017 #ifndef __FCD_OBJECT_H_
    00018 #include "FCDocument/FCDObject.h"
    00019 #endif // __FCD_OBJECT_H_
    00020
    00021 class FCDocument;
    00022 class FCDEffectCode;
    00023
    00031 class FCOLLADA_EXPORT FCDEffectPassBind : public FCDObject
    00032 {
    00033 private:
    00034     DeclareObjectType(FCDObject);
    00035
    00036 public:
    00039     FCDEffectPassBind(FCDocument* document);
    00040
    00041     DeclareParameter(fm::string, FUParameterQualifiers::SIMPLE, reference, FC("Parameter Reference"));
    00042     DeclareParameter(fm::string, FUParameterQualifiers::SIMPLE, symbol, FC("Shader Symbol"));
    00043 };
    00044
    00056 class FCOLLADA_EXPORT FCDEffectPassShader : public FCDObject
    00057 {
    00058 private:
    00059     DeclareObjectType(FCDObject);
    00060
    00061     FCDEffectPass* parent;
    00062     DeclareParameter(fm::string, FUParameterQualifiers::SIMPLE, name, FC("Name"));
    00063     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, compilerTarget, FC("Compiler Target"));
    00064     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, compilerOptions, FC("Compiler Options"));
    00065     DeclareParameterContainer(FCDEffectPassBind, bindings, FC("Shader Bindings"));
    00066     DeclareParameterPtr(FCDEffectCode, code, FC("Shader Code"));
    00067     DeclareParameter(bool, FUParameterQualifiers::SIMPLE, isFragment, FC("Is Fragment Shader"));
    00068
    00069 public:
    00073     FCDEffectPassShader(FCDocument* document, FCDEffectPass* parent);
    00074
    00076     virtual ~FCDEffectPassShader();
    00077
    00080     inline FCDEffectPass* GetParent() { return parent; }
    00081     inline const FCDEffectPass* GetParent() const { return parent; }
    00085     inline void AffectsVertices() { isFragment = false; SetDirtyFlag(); }
    00086
    00089     inline void AffectsFragments() { isFragment = true; SetDirtyFlag(); }
    00090
    00093     inline bool IsFragmentShader() const { return isFragment; }
    00094
    00097     inline bool IsVertexShader() const { return !isFragment; }
    00098
    00101     DEPRECATED(3.05A, GetBindingCount and GetBinding(index)) void GetBindings() const {}
    00102
    00105     inline size_t GetBindingCount() const { return bindings.size(); }
    00106
    00110     inline FCDEffectPassBind* GetBinding(size_t index) { FUAssert(index < GetBindingCount(), return NULL); return bindings.at(index); }
    00111     inline const FCDEffectPassBind* GetBinding(size_t index) const { FUAssert(index < GetBindingCount(), return NULL); return bindings.at(index); }
    00117     const FCDEffectPassBind* FindBindingReference(const char* reference) const;
    00118     inline FCDEffectPassBind* FindBindingReference(const char* reference) { return const_cast<FCDEffectPassBind*>(const_cast<const FCDEffectPassShader*>(this)->FindBindingReference(reference)); }
    00124     const FCDEffectPassBind* FindBindingSymbol(const char* symbol) const;
    00125     inline FCDEffectPassBind* FindBindingSymbol(const char* symbol) { return const_cast<FCDEffectPassBind*>(const_cast<const FCDEffectPassShader*>(this)->FindBindingSymbol(symbol)); }
    00129     FCDEffectPassBind* AddBinding();
    00130
    00133     DEPRECATED(3.05A, binding->Release()) void ReleaseBinding(FCDEffectPassBind* binding) { SAFE_RELEASE(binding); }
    00134
    00138     inline const fstring& GetCompilerTarget() const { return compilerTarget; }
    00139
    00143     inline void SetCompilerTarget(const fchar* _compilerTarget) { compilerTarget = _compilerTarget; SetDirtyFlag(); }
    00144
    00148     inline const fstring& GetCompilerOptions() const { return compilerOptions; }
    00149
    00153     inline void SetCompilerOptions(const fchar* _compilerOptions) { compilerOptions = _compilerOptions; SetDirtyFlag(); }
    00154
    00157     inline const fm::string& GetName() const { return name; }
    00158
    00161     inline void SetName(const char* _name) { name = _name; SetDirtyFlag(); }
    00162
    00166     inline FCDEffectCode* GetCode() { return code; }
    00167     inline const FCDEffectCode* GetCode() const { return code; }
    00172     inline void SetCode(FCDEffectCode* _code) { code = _code; SetDirtyFlag(); }
    00173
    00178     FCDEffectPassShader* Clone(FCDEffectPassShader* clone) const;
    00179 };
    00180
    00181 #endif // _FCD_EFFECT_PASS_SHADER_H_