Raylib C++  1.0.0
Encapsulates the raylib library
Public Member Functions | List of all members
raylib::shader::RlShader Class Reference

Encapsultation of the raylib Shader NOTE: Shader functionality is not available on OpenGL 1.1. More...

#include <RlShader.hpp>

Collaboration diagram for raylib::shader::RlShader:
Collaboration graph

Public Member Functions

 RlShader ()
 Construct a new RlShader object. More...
 
 ~RlShader ()
 Destroy the RlShader object. More...
 
void load (const std::string &vsFileName, const std::string &fsFileName)
 Load a shader from a file. More...
 
void loadFromMemory (const std::string &vsCode, const std::string &fsCode)
 Load a shader from code strings. More...
 
int getLocation (const std::string &uniformName)
 Get shader uniform location. More...
 
int getLocationAttrib (const std::string &attribName)
 Get shader attribute location. More...
 
void setValue (int locIndex, const void *value, int uniformType)
 Set shader uniform value. More...
 
void setValueV (int locIndex, const void *value, int uniformType, int count)
 Set shader uniform value vector. More...
 
void setValueMatrix (int locIndex, const Matrix &mat)
 Set shader uniform value (matrix 4x4) More...
 
void setValueTexture (int locIndex, const texture::RlTexture &texture)
 Set shader uniform value for texture (sampler2d) More...
 
const Shader & getShader () const
 Get the raylib Shader's. More...
 

Detailed Description

Encapsultation of the raylib Shader NOTE: Shader functionality is not available on OpenGL 1.1.

Constructor & Destructor Documentation

◆ RlShader()

raylib::shader::RlShader::RlShader ( )

Construct a new RlShader object.

◆ ~RlShader()

raylib::shader::RlShader::~RlShader ( )

Destroy the RlShader object.

Member Function Documentation

◆ getLocation()

int raylib::shader::RlShader::getLocation ( const std::string &  uniformName)

Get shader uniform location.

Parameters
uniformNameto get
Returns
the location of the uniform

◆ getLocationAttrib()

int raylib::shader::RlShader::getLocationAttrib ( const std::string &  attribName)

Get shader attribute location.

Parameters
attribNameto get
Returns
the location of the attribute

◆ getShader()

const Shader & raylib::shader::RlShader::getShader ( ) const

Get the raylib Shader's.

Returns
the raylib Shader
Here is the caller graph for this function:

◆ load()

void raylib::shader::RlShader::load ( const std::string &  vsFileName,
const std::string &  fsFileName 
)

Load a shader from a file.

Parameters
vsFileNamethe vertex shader file name
fsFileNamethe fragment shader file name

◆ loadFromMemory()

void raylib::shader::RlShader::loadFromMemory ( const std::string &  vsCode,
const std::string &  fsCode 
)

Load a shader from code strings.

Parameters
vsCodethe vertex shader code
fsCodethe fragment shader code

◆ setValue()

void raylib::shader::RlShader::setValue ( int  locIndex,
const void *  value,
int  uniformType 
)

Set shader uniform value.

Parameters
locIndexto set
valueto set
uniformTypeto set

◆ setValueMatrix()

void raylib::shader::RlShader::setValueMatrix ( int  locIndex,
const Matrix &  mat 
)

Set shader uniform value (matrix 4x4)

Parameters
locIndexto set
matto set

◆ setValueTexture()

void raylib::shader::RlShader::setValueTexture ( int  locIndex,
const texture::RlTexture texture 
)

Set shader uniform value for texture (sampler2d)

Parameters
locIndexto set
textureto set
Here is the call graph for this function:

◆ setValueV()

void raylib::shader::RlShader::setValueV ( int  locIndex,
const void *  value,
int  uniformType,
int  count 
)

Set shader uniform value vector.

Parameters
locIndexto set
valueto set
uniformTypeto set
countto set

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