Shader.loadFromMemory

Load both the vertex and fragment shaders from source codes in memory.

This function loads both the vertex and the fragment shaders. If one of them fails to load, the shader is left empty (the valid shader is unloaded). The sources must be valid shaders 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)
  2. bool loadFromMemory(const(char)[] vertexShader, const(char)[] fragmentShader)
    class Shader
    bool
    loadFromMemory
    (
    const(char)[] vertexShader
    ,
    const(char)[] fragmentShader
    )

Parameters

vertexShader
Type: const(char)[]

String containing the source code of the vertex shader

fragmentShader
Type: const(char)[]

String containing the source code of the fragment shader

Return Value

Type: bool

true if loading succeeded, false if it failed.

Meta