Shader Class Reference

#include <Shader.h>

Description

Allows you to specify rendering programs usually on your GPU.

Shaders are programs compiled and run during runtime to process graphics data. On backends that support them, ithey will usually run on dedicated hardware. Since the actual source language of the Shader depends on the Renderer backend, The rules and behavior of how the shader source will vary greatly.

For the stock OpenGL backend, the shader language will be a variant of GLSL. See https://jcorks.github.io/Dynacoe/shaders-glsl.html for more info.

Public Types

enum  Stage { VertexProcessor }
 
enum  Status {
  Invalid,
  Success,
  NotCompiled
}
 

Functions

void AddStage (Stage, const std::string &)
 
void Compile ()
 
std::string GetLog ()
 
Status GetStatus ()
 
std::string GetShaderLanguage ()
 
ProgramID GetID ()
 

Member Enumeration Documentation

enum Stage
strong

The stages that sources can be attached to.

Enumerator
VertexProcessor 

First stage of the shader. Processes each vertex.

enum Status
strong

The stauts of the program.

Enumerator
Invalid 

Compile() was called, but the compilation failed. AddStage() and Copmile() may be called again to fix the bad stage(s).

Success 

Compile() was successful and the Shader may be used in rendering. See Material.

NotCompiled 

Compile has not yet been called.

Member Function Documentation

void AddStage ( Stage  ,
const std::string &   
)

Adds a stage to the shader program. If the stage already exists and the program has not been compiled succesfully, this call replaces the old source with this source.

void Compile ( )

Finalizes the programs stages. After this call, GetStatus() will either return Success, meaning the program is now usable, or Invalid, meaning compilation failed. In the case of failure, GetLog() may contain more information as to why the compilation failed.

std::string GetLog ( )

Returns any additional logging information from the shader program. If the status Invalid, typically the log will contain information on why.

Status GetStatus ( )

Returns the current program status.

std::string GetShaderLanguage ( )

Returns a string containing the shader language recognized by the Shaders. This is dependent on the parameters of the Renderer used by Graphics.

ProgramID GetID ( )
inline

Returns a Renderer::ProgramID refering to this shader.


The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Shader.h