raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | List of all members
raylib::Shader Class Reference

Shader type (generic) More...

Public Member Functions

 Shader (const ::Shader &shader)
 
 Shader (const char *vsFileName, const char *fsFileName)
 
 Shader (const Shader &)=delete
 
 Shader (const std::string &vsFileName, const std::string &fsFileName)
 
 Shader (Shader &&other)
 
 Shader (unsigned int id, int *locs=nullptr)
 
Shader & BeginMode ()
 Begin custom shader drawing.
 
Shader & EndMode ()
 End custom shader drawing (use default shader).
 
unsigned int GetId () const
 Retrieves the id value for the object. More...
 
int GetLocation (const std::string &uniformName) const
 Get shader uniform location. More...
 
int GetLocationAttrib (const std::string &attribName) const
 Get shader attribute location. More...
 
int * GetLocs () const
 Retrieves the locs value for the object. More...
 
bool IsReady () const
 Retrieves whether or not the shader is ready.
 
Shader & operator= (const ::Shader &shader)
 
Shader & operator= (const Shader &)=delete
 
Shader & operator= (Shader &&other) noexcept
 
void SetId (unsigned int value)
 Sets the id value for the object. More...
 
void SetLocs (int *value)
 Sets the locs value for the object. More...
 
Shader & SetValue (int uniformLoc, const ::Matrix &mat)
 Set shader uniform value (matrix 4x4) More...
 
Shader & SetValue (int uniformLoc, const ::Texture2D &texture)
 Set shader uniform value for texture. More...
 
Shader & SetValue (int uniformLoc, const void *value, int uniformType)
 Set shader uniform value. More...
 
Shader & SetValue (int uniformLoc, const void *value, int uniformType, int count)
 Set shader uniform value vector. More...
 
void Unload ()
 

Static Public Member Functions

::Shader Load (const std::string &vsFileName, const std::string &fsFileName)
 Load shader from files and bind default locations. More...
 
::Shader LoadFromMemory (const std::string &vsCode, const std::string &fsCode)
 Load a shader from memory. More...
 

Detailed Description

Shader type (generic)

Definition at line 14 of file Shader.hpp.

Member Function Documentation

◆ GetId()

unsigned int raylib::Shader::GetId ( ) const
inline

Retrieves the id value for the object.

Returns
The id value of the object.

Definition at line 57 of file Shader.hpp.

◆ GetLocation()

int raylib::Shader::GetLocation ( const std::string &  uniformName) const
inline

Get shader uniform location.

See also
GetShaderLocation()

Definition at line 112 of file Shader.hpp.

◆ GetLocationAttrib()

int raylib::Shader::GetLocationAttrib ( const std::string &  attribName) const
inline

Get shader attribute location.

See also
GetShaderLocationAttrib()

Definition at line 121 of file Shader.hpp.

◆ GetLocs()

int* raylib::Shader::GetLocs ( ) const
inline

Retrieves the locs value for the object.

Returns
The locs value of the object.

Definition at line 58 of file Shader.hpp.

◆ Load()

::Shader raylib::Shader::Load ( const std::string &  vsFileName,
const std::string &  fsFileName 
)
inlinestatic

Load shader from files and bind default locations.

See also
::LoadShader

Definition at line 44 of file Shader.hpp.

◆ LoadFromMemory()

::Shader raylib::Shader::LoadFromMemory ( const std::string &  vsCode,
const std::string &  fsCode 
)
inlinestatic

Load a shader from memory.

See also
::LoadShaderFromMemory

Definition at line 53 of file Shader.hpp.

◆ SetId()

void raylib::Shader::SetId ( unsigned int  value)
inline

Sets the id value for the object.

Parameters
valueThe value of which to set id to.

Definition at line 57 of file Shader.hpp.

◆ SetLocs()

void raylib::Shader::SetLocs ( int *  value)
inline

Sets the locs value for the object.

Parameters
valueThe value of which to set locs to.

Definition at line 58 of file Shader.hpp.

◆ SetValue() [1/4]

Shader& raylib::Shader::SetValue ( int  uniformLoc,
const ::Matrix &  mat 
)
inline

Set shader uniform value (matrix 4x4)

See also
SetShaderValueMatrix()

Definition at line 150 of file Shader.hpp.

◆ SetValue() [2/4]

Shader& raylib::Shader::SetValue ( int  uniformLoc,
const ::Texture2D &  texture 
)
inline

Set shader uniform value for texture.

See also
SetShaderValueTexture()

Definition at line 160 of file Shader.hpp.

◆ SetValue() [3/4]

Shader& raylib::Shader::SetValue ( int  uniformLoc,
const void *  value,
int  uniformType 
)
inline

Set shader uniform value.

See also
SetShaderValue()

Definition at line 130 of file Shader.hpp.

◆ SetValue() [4/4]

Shader& raylib::Shader::SetValue ( int  uniformLoc,
const void *  value,
int  uniformType,
int  count 
)
inline

Set shader uniform value vector.

See also
SetShaderValueV()

Definition at line 140 of file Shader.hpp.