ShaderProgram   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm

Implementation

(bind-func ShaderProgram
  "compile and link shader program (vert and frag shader)"
  (lambda (name:String* vert:Shader* geom:Shader* frag:Shader*)
    (if (not (and (= (type vert) GL_VERTEX_SHADER)
                  (= (type geom) GL_GEOMETRY_SHADER)
                  (= (type frag) GL_FRAGMENT_SHADER)))
        (begin (println "Error: input shader types must be vert, geom and frag respectively.")
               null)
        (let ((program (ShaderProgram:[ShaderProgram*,i32,Shader*,Shader*,Shader*,String*]* (glCreateProgram) vert frag geom name)))
          (glAttachShader (id program) (id vert))
          (glAttachShader (id program) (id geom))
          (glAttachShader (id program) (id frag))
          (glLinkProgram (id program))
          (gl_print_error "Error making shader program!")
          (println 'ShaderProgram: program)
          program))))


Back to Index

Similar Entries

  • ShaderProgram    xtlang
  • ShaderProgram    xtlang
  • ShaderProgram    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_print_info_log    xtlang