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

Shader type (generic), not managed by C++ RAII. More...

Public Member Functions

 ShaderUnmanaged (const ::Shader &shader)
 
 ShaderUnmanaged (const char *vsFileName, const char *fsFileName)
 
 ShaderUnmanaged (const std::string &vsFileName, const std::string &fsFileName)
 
 ShaderUnmanaged (unsigned int id, int *locs=nullptr)
 
ShaderUnmanagedBeginMode ()
 Begin custom shader drawing.
 
ShaderUnmanagedEndMode ()
 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 IsValid () const
 Retrieves whether or not the shader is ready.
 
ShaderUnmanagedoperator= (const ::Shader &shader)
 
ShaderUnmanagedSetValue (int uniformLoc, const ::Matrix &mat)
 Set shader uniform value (matrix 4x4) More...
 
ShaderUnmanagedSetValue (int uniformLoc, const ::Texture2D &texture)
 Set shader uniform value for texture. More...
 
ShaderUnmanagedSetValue (int uniformLoc, const void *value, int uniformType)
 Set shader uniform value. More...
 
ShaderUnmanagedSetValue (int uniformLoc, const void *value, int uniformType, int count)
 Set shader uniform value vector. More...
 

Static Public Member Functions

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

Protected Member Functions

void set (const ::Shader &shader)
 

Detailed Description

Shader type (generic), not managed by C++ RAII.

Definition at line 16 of file ShaderUnmanaged.hpp.

Member Function Documentation

◆ GetId()

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

Retrieves the id value for the object.

Returns
The id value of the object.

Definition at line 53 of file ShaderUnmanaged.hpp.

◆ GetLocation()

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

Get shader uniform location.

See also
GetShaderLocation()

Definition at line 82 of file ShaderUnmanaged.hpp.

◆ GetLocationAttrib()

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

Get shader attribute location.

See also
GetShaderLocationAttrib()

Definition at line 89 of file ShaderUnmanaged.hpp.

◆ GetLocs()

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

Retrieves the locs value for the object.

Returns
The locs value of the object.

Definition at line 54 of file ShaderUnmanaged.hpp.

◆ Load()

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

Load shader from files and bind default locations.

See also
::LoadShader

Definition at line 34 of file ShaderUnmanaged.hpp.

◆ LoadFromMemory()

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

Load a shader from memory.

See also
::LoadShaderFromMemory

Definition at line 46 of file ShaderUnmanaged.hpp.

◆ SetValue() [1/4]

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

Set shader uniform value (matrix 4x4)

See also
SetShaderValueMatrix()

Definition at line 118 of file ShaderUnmanaged.hpp.

◆ SetValue() [2/4]

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

Set shader uniform value for texture.

See also
SetShaderValueTexture()

Definition at line 128 of file ShaderUnmanaged.hpp.

◆ SetValue() [3/4]

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

Set shader uniform value.

See also
SetShaderValue()

Definition at line 98 of file ShaderUnmanaged.hpp.

◆ SetValue() [4/4]

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

Set shader uniform value vector.

See also
SetShaderValueV()

Definition at line 108 of file ShaderUnmanaged.hpp.