Shader.loadFromFile

Load both the vertex and fragment shaders from files.

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 text files containing 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 loadFromFile(const(char)[] filename, Type type)
  2. bool loadFromFile(const(char)[] vertexShaderFilename, const(char)[] fragmentShaderFilename)
    class Shader
    bool
    loadFromFile
    (
    const(char)[] vertexShaderFilename
    ,
    )

Parameters

vertexShaderFilename
Type: const(char)[]

Path of the vertex shader file to load

fragmentShaderFilename
Type: const(char)[]

Path of the fragment shader file to load

Return Value

Type: bool

true if loading succeeded, false if it failed.

Meta