/// <summary> /// Default constructor. /// </summary> public GLSLLinkProgram(GLSLGpuProgram vertexProgram, GLSLGpuProgram geometryProgram, GLSLGpuProgram fragmentProgram) { this.vertexProgram = vertexProgram; this.geometryProgram = geometryProgram; this.fragmentProgram = fragmentProgram; this.uniformRefsBuilt = false; this.linked = false; this.triedToLinkAndFailed = false; }
/// <summary> /// Set the active vertex shader for the next rendering state. /// </summary> /// <remarks> /// The active program object will be cleared. /// Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods /// </remarks> /// <param name="vertexProgram"></param> public void SetActiveVertexShader(GLSLGpuProgram vertexProgram) { if (vertexProgram != this.activeVertexProgram) { this.activeVertexProgram = vertexProgram; // active link program is no longer valid this.activeLinkProgram = null; // change back to fixed pipeline Gl.glUseProgramObjectARB(0); } }
/// <summary> /// Set the active geometry shader for the next rendering state. /// </summary> /// <remarks> /// The active program object will be cleared. /// Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods /// </remarks> /// <param name="vertexProgram"></param> public void SetActiveGeometryShader(GLSLGpuProgram geometryProgram) { if (geometryProgram != this.activeGeometryProgram) { this.activeGeometryProgram = geometryProgram; // active link program is no longer valid this.activeLinkProgram = null; // change back to fixed pipeline Gl.glUseProgramObjectARB(0); } }
/// <summary> /// Set the active fragment shader for the next rendering state. /// </summary> /// <remarks> /// The active program object will be cleared. /// Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods /// </remarks> /// <param name="fragmentProgram"></param> public void SetActiveFragmentShader(GLSLGpuProgram fragmentProgram) { if (fragmentProgram != this.activeFragmentProgram) { this.activeFragmentProgram = fragmentProgram; // active link program is no longer valid this.activeLinkProgram = null; // change back to fixed pipeline Gl.glUseProgramObjectARB(0); } }
protected override void CreateLowLevelImpl() { assemblerProgram = new GLSLGpuProgram(this); }
protected override void CreateLowLevelImpl() { assemblerProgram = new GLSLGpuProgram( this ); }
/// <summary> /// Set the active vertex shader for the next rendering state. /// </summary> /// <remarks> /// The active program object will be cleared. /// Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods /// </remarks> /// <param name="vertexProgram"></param> public void SetActiveVertexShader(GLSLGpuProgram vertexProgram) { if(vertexProgram != activeVertexProgram) { activeVertexProgram = vertexProgram; // active link program is no longer valid activeLinkProgram = null; // change back to fixed pipeline Gl.glUseProgramObjectARB(0); } }
/// <summary> /// Set the active fragment shader for the next rendering state. /// </summary> /// <remarks> /// The active program object will be cleared. /// Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods /// </remarks> /// <param name="fragmentProgram"></param> public void SetActiveFragmentShader(GLSLGpuProgram fragmentProgram) { if(fragmentProgram != activeFragmentProgram) { activeFragmentProgram = fragmentProgram; // active link program is no longer valid activeLinkProgram = null; // change back to fixed pipeline Gl.glUseProgramObjectARB(0); } }
/// <summary> /// Set the active geometry shader for the next rendering state. /// </summary> /// <remarks> /// The active program object will be cleared. /// Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods /// </remarks> /// <param name="vertexProgram"></param> public void SetActiveGeometryShader( GLSLGpuProgram geometryProgram ) { if (geometryProgram != activeGeometryProgram) { activeGeometryProgram = geometryProgram; // active link program is no longer valid activeLinkProgram = null; // change back to fixed pipeline Gl.glUseProgramObjectARB( 0 ); } }