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

Public Member Functions

 Shader ()
 
 Shader (const ::Shader &shader)
 
 Shader (const std::string &vsFileName, const std::string &fsFileName)
 
 Shader (unsigned int Id, int *Locs)
 
 ~Shader ()
 
Shader & BeginMode ()
 Begin custom shader drawing. More...
 
Shader & EndMode ()
 End custom shader drawing (use default shader). More...
 
::Texture2D GenTextureBRDF (int size) const
 
::TextureCubemap GenTextureCubemap (const ::Texture2D &panorama, int size, int format) const
 
::TextureCubemap GenTextureIrradiance (const ::Texture2D &panorama, int size) const
 
::TextureCubemap GenTexturePrefilter (const ::Texture2D &panorama, int size) const
 
unsigned int GetId () const
 
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
 
Shader & operator= (const ::Shader &shader)
 
void SetId (unsigned int value)
 
void SetLocs (int *value)
 
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 std::string &value, int uniformType)
 Set shader uniform value. More...
 
Shader & SetValue (int uniformLoc, const std::string &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 LoadCode (const std::string &vsCode, const std::string &fsCode)
 Load shader from code strings and bind default locations. More...
 

Protected Member Functions

void set (const ::Shader &shader)
 

Detailed Description

Definition at line 35 of file Shader.hpp.

Constructor & Destructor Documentation

◆ Shader() [1/4]

raylib::Shader::Shader ( const ::Shader &  shader)
inline

Definition at line 37 of file Shader.hpp.

References set().

◆ Shader() [2/4]

raylib::Shader::Shader ( unsigned int  Id,
int *  Locs 
)
inline

Definition at line 41 of file Shader.hpp.

◆ Shader() [3/4]

raylib::Shader::Shader ( )
inline

Definition at line 46 of file Shader.hpp.

References set().

◆ Shader() [4/4]

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

Definition at line 50 of file Shader.hpp.

References set().

◆ ~Shader()

raylib::Shader::~Shader ( )
inline

Definition at line 76 of file Shader.hpp.

References Unload().

Member Function Documentation

◆ BeginMode()

Shader& raylib::Shader::BeginMode ( )
inline

Begin custom shader drawing.

Definition at line 87 of file Shader.hpp.

◆ EndMode()

Shader& raylib::Shader::EndMode ( )
inline

End custom shader drawing (use default shader).

Definition at line 95 of file Shader.hpp.

◆ GenTextureBRDF()

::Texture2D raylib::Shader::GenTextureBRDF ( int  size) const
inline

Definition at line 166 of file Shader.hpp.

◆ GenTextureCubemap()

::TextureCubemap raylib::Shader::GenTextureCubemap ( const ::Texture2D &  panorama,
int  size,
int  format 
) const
inline

Definition at line 154 of file Shader.hpp.

◆ GenTextureIrradiance()

::TextureCubemap raylib::Shader::GenTextureIrradiance ( const ::Texture2D &  panorama,
int  size 
) const
inline

Definition at line 158 of file Shader.hpp.

◆ GenTexturePrefilter()

::TextureCubemap raylib::Shader::GenTexturePrefilter ( const ::Texture2D &  panorama,
int  size 
) const
inline

Definition at line 162 of file Shader.hpp.

◆ GetId()

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

Definition at line 68 of file Shader.hpp.

◆ GetLocation()

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

Get shader uniform location.

Definition at line 103 of file Shader.hpp.

◆ GetLocationAttrib()

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

Get shader attribute location.

Definition at line 110 of file Shader.hpp.

◆ GetLocs()

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

Definition at line 69 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.

Definition at line 57 of file Shader.hpp.

◆ LoadCode()

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

Load shader from code strings and bind default locations.

Definition at line 64 of file Shader.hpp.

◆ operator=()

Shader& raylib::Shader::operator= ( const ::Shader &  shader)
inline

Definition at line 71 of file Shader.hpp.

References set().

◆ set()

void raylib::Shader::set ( const ::Shader &  shader)
inlineprotected

Definition at line 171 of file Shader.hpp.

Referenced by operator=(), and Shader().

◆ SetId()

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

Definition at line 68 of file Shader.hpp.

◆ SetLocs()

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

Definition at line 69 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 139 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 149 of file Shader.hpp.

◆ SetValue() [3/4]

Shader& raylib::Shader::SetValue ( int  uniformLoc,
const std::string &  value,
int  uniformType 
)
inline

Set shader uniform value.

See also
SetShaderValue()

Definition at line 119 of file Shader.hpp.

◆ SetValue() [4/4]

Shader& raylib::Shader::SetValue ( int  uniformLoc,
const std::string &  value,
int  uniformType,
int  count 
)
inline

Set shader uniform value vector.

See also
SetShaderValueV()

Definition at line 129 of file Shader.hpp.

◆ Unload()

void raylib::Shader::Unload ( )
inline

Definition at line 80 of file Shader.hpp.

Referenced by ~Shader().