Shader.loadFromFile

Load either the vertex or fragment shader from a file.

This function loads a single shader, either vertex or fragment, identified by the second argument. The source must be a text file containing 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 loadFromFile(const(char)[] filename, Type type)
    class Shader
    bool
    loadFromFile
    (
    const(char)[] filename
    ,
    )
  2. bool loadFromFile(const(char)[] vertexShaderFilename, const(char)[] fragmentShaderFilename)

Parameters

filename
Type: const(char)[]

Path of the vertex or fragment shader file to load

type
Type: Type

Type of shader (vertex or fragment)

Return Value

Type: bool

true if loading succeeded, false if it failed.

Meta