File indexing completed on 2025-01-18 10:04:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _OpenGl_AspectsProgram_Header
0015 #define _OpenGl_AspectsProgram_Header
0016
0017 #include <Graphic3d_ShaderProgram.hxx>
0018
0019 class Graphic3d_Aspects;
0020 class OpenGl_Context;
0021 class OpenGl_ShaderProgram;
0022
0023
0024 class OpenGl_AspectsProgram
0025 {
0026 public:
0027 DEFINE_STANDARD_ALLOC
0028 public:
0029
0030 OpenGl_AspectsProgram() : myIsShaderReady (false) {}
0031
0032
0033 const Handle(OpenGl_ShaderProgram)& ShaderProgram (const Handle(OpenGl_Context)& theCtx,
0034 const Handle(Graphic3d_ShaderProgram)& theShader)
0035 {
0036 if (!myIsShaderReady)
0037 {
0038 build (theCtx, theShader);
0039 myIsShaderReady = true;
0040 }
0041 return myShaderProgram;
0042 }
0043
0044
0045 Standard_EXPORT void UpdateRediness (const Handle(Graphic3d_Aspects)& theAspect);
0046
0047
0048 Standard_EXPORT void Release (OpenGl_Context* theCtx);
0049
0050 private:
0051
0052
0053 Standard_EXPORT void build (const Handle(OpenGl_Context)& theCtx,
0054 const Handle(Graphic3d_ShaderProgram)& theShader);
0055
0056 private:
0057
0058 Handle(OpenGl_ShaderProgram) myShaderProgram;
0059 TCollection_AsciiString myShaderProgramId;
0060 Standard_Boolean myIsShaderReady;
0061 };
0062
0063 #endif