Program.attach

attach shaders to Program

struct Program
nothrow @trusted
attach
(
Args...
)
(
Args shaders
)
if (
Args.length > 0 &&
isShaderSeq!Args
)

Parameters

shaders Args

AliasSeq of shaders

Return Value

Type: GLResult!void

GLResult!void with GLError:

  • GLError.Flag.NO_ERROR: If attached correctly and there are no errors
  • GLError.Flag.INVALID_PROGRAM: if program hasn't been initialized properly
  • GLError.Flag.INVALID_SHADER: if shader hasn't been initialized if shader hasn't been compiled succesfully
  • GLError.Flag.SHADER_ALREADY_ATTACHED: if Shader s has already been attached to program

Examples

// Initialize program and shaders
Program program = ...
Shader vertex_shader = ...
Shader frag_shader = ...

// Call [gl_attach_shader] per shader and throw on error
program.attach(vertex_shader, frag_shader).throw_on_error;

Meta