From d5a72622e5016993c899f2141a68087dccaec3e8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 28 Mar 2009 17:38:51 +0000 Subject: [PATCH] Add clearAllShaderInputs --- panda/src/pgraph/shaderAttrib.cxx | 12 ++++++++++++ panda/src/pgraph/shaderAttrib.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/panda/src/pgraph/shaderAttrib.cxx b/panda/src/pgraph/shaderAttrib.cxx index af0c3f6ac7..4e2a552246 100755 --- a/panda/src/pgraph/shaderAttrib.cxx +++ b/panda/src/pgraph/shaderAttrib.cxx @@ -281,6 +281,18 @@ clear_shader_input(const string &id) const { return clear_shader_input(InternalName::make(id)); } +//////////////////////////////////////////////////////////////////// +// Function: ShaderAttrib::clear_all_shader_inputs +// Access: Published +// Description: Clears all the shader inputs on the attrib. +//////////////////////////////////////////////////////////////////// +CPT(RenderAttrib) ShaderAttrib:: +clear_all_shader_inputs() const { + ShaderAttrib *result = new ShaderAttrib(*this); + result->_inputs.clear(); + return return_new(result); +} + //////////////////////////////////////////////////////////////////// // Function: ShaderAttrib::get_shader_input // Access: Published diff --git a/panda/src/pgraph/shaderAttrib.h b/panda/src/pgraph/shaderAttrib.h index 658a7c8faa..3c83b73617 100755 --- a/panda/src/pgraph/shaderAttrib.h +++ b/panda/src/pgraph/shaderAttrib.h @@ -67,6 +67,8 @@ PUBLISHED: CPT(RenderAttrib) clear_shader_input(InternalName *id) const; CPT(RenderAttrib) clear_shader_input(const string &id) const; + + CPT(RenderAttrib) clear_all_shader_inputs() const; INLINE bool get_flag(int flag) const;