Browse Source

Added Lua API to access a renderpath's commands.

Lasse Öörni 11 years ago
parent
commit
6f3ef0c3f4

+ 2 - 0
Source/Urho3D/Graphics/RenderPath.h

@@ -230,6 +230,8 @@ public:
     unsigned GetNumRenderTargets() const { return renderTargets_.Size(); }
     /// Return number of commands.
     unsigned GetNumCommands() const { return commands_.Size(); }
+    /// Return command at index, or null if does not exist.
+    RenderPathCommand* GetCommand(unsigned index) { return index < commands_.Size() ? &commands_[index] : nullptr; }
     /// Return a shader parameter (first appearance in any command.)
     const Variant& GetShaderParameter(const String& name) const;
     

+ 1 - 0
Source/Urho3D/LuaScript/pkgs/Graphics/RenderPath.pkg

@@ -76,6 +76,7 @@ class RenderPath
 
     unsigned GetNumRenderTargets() const;
     unsigned GetNumCommands() const;
+    RenderPathCommand* GetCommand(unsigned index); 
     const Variant& GetShaderParameter(const String name) const;
 };