Shader.loadFromMemory

Load the vertex, geometry, or fragment shader from a source code in memory.

This function loads a single shader, vertex, geometry, or fragment, identified by the second argument. The source code must be a valid shader in GLSL language. GLSL is a C-like language dedicated to OpenGL shaders; you'll probably need to read a good documentation for it before writing your own shaders.

  1. bool loadFromMemory(const(char)[] shader, Type type)
    class Shader
    bool
    loadFromMemory
    (
    const(char)[] shader
    ,)
  2. bool loadFromMemory(const(char)[] vertexShader, const(char)[] geometryShader, const(char)[] fragmentShader)

Parameters

shader const(char)[]

String containing the source code of the shader

type Type

Type of shader (vertex geometry, or fragment)

Return Value

Type: bool

true if loading succeeded, false if it failed.

Meta