| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- $#include "Graphics/Technique.h"
- enum PassLightingMode
- {
- LIGHTING_UNLIT,
- LIGHTING_PERVERTEX,
- LIGHTING_PERPIXEL
- };
- class Pass : public RefCounted
- {
- void SetBlendMode(BlendMode mode);
- void SetCullMode(CullMode mode);
- void SetDepthTestMode(CompareMode mode);
- void SetLightingMode(PassLightingMode mode);
- void SetDepthWrite(bool enable);
- void SetAlphaToCoverage(bool enable);
- void SetIsDesktop(bool enable);
- void SetVertexShader(const String name);
- void SetPixelShader(const String name);
- void SetVertexShaderDefines(const String defines);
- void SetPixelShaderDefines(const String defines);
- void SetVertexShaderDefineExcludes(const String excludes);
- void SetPixelShaderDefineExcludes(const String excludes);
- void ReleaseShaders();
- const String GetName() const;
- unsigned GetIndex() const;
- CullMode GetCullMode() const;
- BlendMode GetBlendMode() const;
- CompareMode GetDepthTestMode() const;
- PassLightingMode GetLightingMode() const;
- bool GetDepthWrite() const;
- bool GetAlphaToCoverage() const;
- bool IsDesktop() const;
- const String GetVertexShader() const;
- const String GetPixelShader() const;
- const String GetVertexShaderDefines() const;
- const String GetPixelShaderDefines() const;
- const String GetVertexShaderDefineExcludes() const;
- const String GetPixelShaderDefineExcludes() const;
- tolua_readonly tolua_property__get_set String name;
- tolua_readonly tolua_property__get_set unsigned index;
- tolua_property__get_set BlendMode blendMode;
- tolua_property__get_set CullMode cullMode;
- tolua_property__get_set CompareMode depthTestMode;
- tolua_property__get_set PassLightingMode lightingMode;
- tolua_property__get_set bool depthWrite;
- tolua_property__get_set bool alphaToCoverage;
- tolua_readonly tolua_property__is_set bool desktop;
- tolua_property__get_set String vertexShader;
- tolua_property__get_set String pixelShader;
- tolua_property__get_set String vertexShaderDefines;
- tolua_property__get_set String pixelShaderDefines;
- tolua_property__get_set String vertexShaderDefineExcludes;
- tolua_property__get_set String pixelShaderDefineExcludes;
- };
- class Technique : public Resource
- {
- void SetIsDesktop(bool enable);
- Pass* CreatePass(const String passName);
- void RemovePass(const String passName);
- void ReleaseShaders();
- tolua_outside Technique* TechniqueClone @ Clone(const String cloneName = String::EMPTY) const;
- bool HasPass(const String type) const;
- Pass* GetPass(const String type) const;
- Pass* GetSupportedPass(const String type) const;
- bool IsSupported() const;
- bool IsDesktop() const;
- unsigned GetNumPasses() const;
- tolua_outside const Vector<String>& TechniqueGetPassNames @ GetPassTypes() const;
- tolua_outside const PODVector<Pass*>& TechniqueGetPasses @ GetPasses() const;
- tolua_readonly tolua_property__is_set bool supported;
- tolua_readonly tolua_property__is_set bool desktop;
- tolua_readonly tolua_property__get_set unsigned numPasses;
- };
- ${
- static const Vector<String>& TechniqueGetPassNames(const Technique* technique)
- {
- static Vector<String> vector = technique->GetPassNames();
- return vector;
- }
- static const PODVector<Pass*>& TechniqueGetPasses(const Technique* technique)
- {
- static PODVector<Pass*> vector = technique->GetPasses();
- return vector;
- }
- static Technique* TechniqueClone(const Technique* technique, const String& cloneName = String::EMPTY)
- {
- if (!technique)
- return 0;
-
- SharedPtr<Technique> clonedTechniquePtr = technique->Clone(cloneName);
- Technique* clonedTechnique = clonedTechniquePtr.Get();
- clonedTechniquePtr.Detach();
-
- return clonedTechnique;
- }
- $}
|