- function TEVOpenGLShader.Load(shadertype: GLenum; text: String): Boolean;
- var
- shader: GLHandle;
- len: GLint;
- txt: PAnsiChar;
- begin
- fOwner.Bind;
- shader := glCreateShader(shadertype);
- txt := @text[1];
- len := Length(text);
- glShaderSource(shader,1,@txt,@len);
- glCompileShader(shader);
- if CheckShader(shader) then
- begin
- glAttachShader(fProgram, shader);
- Result := true;
- end
- else
- Result := false;
- CheckProgram;
- glDeleteShader(shader);
- end;