(gl-program) ( shaders quot: ( gl-program -- ) -- program ) (original) (raw)
(gl-program) ( shaders quot: ( gl-program -- ) -- program )
Inputs
shaders | a sequence |
---|---|
quot | a quotation |
Outputs
program | a new gl-program |
---|
Word description
Creates a gl program and attaches the shaders to it. Then applies the quotation to the program and finally links it.
Errors
Throws a gl error if linking the program fails.
Definition
USING: kernel opengl opengl.gl ;
: (gl-program)
( shaders quot: ( gl-program -- ) -- program )
glCreateProgram
[ dup roll attach-shaders swap call ] [ glLinkProgram ] [ ]
tri gl-error ; inline