Rasterfarm-SDK
Loading...
Searching...
No Matches
Shader Class Reference

ADT class for creating the OpenGL-ES 2.0 shader object. More...

#include <shader.h>

Public Member Functions

void loadCode (ShaderType type, const char *shaderSourceFile)
 
ShaderType getType () const
 
ShaderHandle getHandle () const
 
String getCode () const
 
size_t getHash ()
 

Static Public Member Functions

static Shadercreate (ShaderType type, const char *shaderSourceFile=nullptr)
 
static Shadercreate (ShaderType type, const String &shaderCode)
 
static String loadCode (const char *const shaderSourceFile)
 
static ShaderHandle compile (ShaderType type, const char *shaderSrc)
 

Protected Attributes

String shaderCode
 
size_t hash
 
ShaderHandle shaderHandle
 
ShaderType type
 

Friends

class Application
 

Detailed Description

ADT class for creating the OpenGL-ES 2.0 shader object.

This abstracts-away vertex and fragment shader binaries for GeometricObject. All derived objects for this class should be singletons.

Member Function Documentation

◆ compile()

static ShaderHandle Shader::compile ( ShaderType type,
const char * shaderSrc )
static

The shader compiliation function.

Parameters
typecan be either VERTEX_SHADER or FRAGMENT_SHADER
sourceCodeString containing the GLSL code.
Returns
the program-object handle

◆ create() [1/2]

static Shader * Shader::create ( ShaderType type,
const char * shaderSourceFile = nullptr )
static

◆ create() [2/2]

static Shader * Shader::create ( ShaderType type,
const String & shaderCode )
static

◆ getCode()

String Shader::getCode ( ) const
inline

◆ getHandle()

ShaderHandle Shader::getHandle ( ) const
inline

◆ getHash()

size_t Shader::getHash ( )
inline

◆ getType()

ShaderType Shader::getType ( ) const
inline

◆ loadCode() [1/2]

static String Shader::loadCode ( const char *const shaderSourceFile)
static

Loads the vertex and fragment shader source code from the filesystem.

Parameters
vertexShaderSourceFileThe file containing the vertex shader code.
fragmentShaderSourceFileThe file containing the fragment shader code.
Returns
void.

◆ loadCode() [2/2]

void Shader::loadCode ( ShaderType type,
const char * shaderSourceFile )

Friends And Related Symbol Documentation

◆ Application

friend class Application
friend

Member Data Documentation

◆ hash

size_t Shader::hash
protected

◆ shaderCode

String Shader::shaderCode
protected

◆ shaderHandle

ShaderHandle Shader::shaderHandle
protected

◆ type

ShaderType Shader::type
protected

The documentation for this class was generated from the following file: