diff --git a/src/Graphic3d/Graphic3d_ShaderProgram.hxx b/src/Graphic3d/Graphic3d_ShaderProgram.hxx index 5118e177ff..3ff305e319 100755 --- a/src/Graphic3d/Graphic3d_ShaderProgram.hxx +++ b/src/Graphic3d/Graphic3d_ShaderProgram.hxx @@ -49,6 +49,11 @@ public: //! Returns unique ID used to manage resource in graphic driver. const TCollection_AsciiString& GetId() const { return myID; } + //! Sets unique ID used to manage resource in graphic driver. + //! WARNING! Graphic3d_ShaderProgram constructor generates a unique id for proper resource management; + //! however if application overrides it, it is responsibility of application to avoid name collisions. + void SetId (const TCollection_AsciiString& theId) { myID = theId; } + //! Returns GLSL header (version code and extensions). const TCollection_AsciiString& Header() const { return myHeader; } diff --git a/src/OpenGl/OpenGl_ShaderProgram.hxx b/src/OpenGl/OpenGl_ShaderProgram.hxx index 702b399a04..897525028d 100755 --- a/src/OpenGl/OpenGl_ShaderProgram.hxx +++ b/src/OpenGl/OpenGl_ShaderProgram.hxx @@ -201,6 +201,9 @@ public: //! Fetches uniform variables from proxy shader program. Standard_EXPORT Standard_Boolean ApplyVariables (const Handle(OpenGl_Context)& theCtx); + //! @return proxy shader program. + const Handle(Graphic3d_ShaderProgram)& Proxy() const { return myProxy; } + //! @return true if current object was initialized inline bool IsValid() const {