1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0031715: Visualization, OpenGl_ShaderProgram - add access to proxy shader program.

Back porting of setting unique ID for shader program used to manage resource in graphic driver.
This commit is contained in:
osa 2020-08-21 11:35:49 +03:00 committed by kgv
parent b05ff75a60
commit c23d6ec61f
2 changed files with 8 additions and 0 deletions

View File

@ -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; }

View File

@ -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
{