On this page:
top
up

24Utility procedures for shadersπŸ”— i

These bindings are in opengl/util and not in opengl.

These procedures can be used to load shaders written in GLSL (the GL Shading Language). Note that these, too, should only be called when an OpenGL context is active!

procedure

( load-shaderfileshader-type)exact-nonnegative->integer?

file:(or/cpath-string?input-port?)
shader-type:exact-nonnegative-integer?
Load a shader written in GLSL from a named file or input port.

The parameter shader-type is typically either GL_VERTEX_SHADER or GL_FRAGMENT_SHADER, although modern OpenGL versions define many more shader types. The returned shader object is already compiled and can be passed directly into create-program.

procedure

( create-programshader...)exact-nonnegative-integer?

shader:exact-nonnegative-integer?
Create a complete GLSL program from combining several shaders.

This procedure takes shaders as created by load-shader and links them together into a single program. The resulting program is already linked and can be passed directly into glUseProgram.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /