Download Now

    Reference TShaderProgram

    Declared in Codebot.Render.Shaders.pas on line 66

    TShaderProgram is vertex and fragment shaders linked together for drawing
      TShaderProgram = class(TShaderObject)
      public
        { Create an empty shader program with nothing attached }
        constructor Create;
        { Create a shader given a vertex and fragement source }
        constructor CreateFromSource(const VertSource, FragSource: string);
        { Create a shader program from a resource or asset }
        constructor CreateFromAsset(const Name: string); overload;
        { Create a shader program with two files ending in .vert and .frag }
        constructor CreateFromFile(const ProgramName: string); overload;
        { Create a shader program two specific vert and frag files }
        constructor CreateFromFile(const VertFileName, FragFileName: string); overload;
        destructor Destroy; override;
        { Add the shader to the program stack and activate it }
        procedure Push;
        { Remove the shader to from the program stack and deactivate it }
        procedure Pop;
        { Attach a vertex or fragment source }
        procedure Attach(Source: TShaderSource);
        { Perform linking of attached sources returning true if there were no errors }
        function Link: Boolean;
        { Update the modelview and projection matrix uniforms for this program }
        procedure UpdateMatrix;
        { Active is the same as pushing or popping }
        property Active: Boolean read GetActive write SetActive;
      end;

    See also