raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
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...

#include <ShaderUnmanaged.hpp>

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)
 
ShaderUnmanaged & BeginMode ()
 Begin custom shader drawing.
 
ShaderUnmanaged & EndMode ()
 End custom shader drawing (use default shader).
 
unsigned int GetId () const
 Retrieves the id value for the object.
 
int GetLocation (const std::string &uniformName) const
 Get shader uniform location.
 
int GetLocationAttrib (const std::string &attribName) const
 Get shader attribute location.
 
int * GetLocs () const
 Retrieves the locs value for the object.
 
bool IsValid () const
 Retrieves whether or not the shader is ready.
 
ShaderUnmanaged & operator= (const ::Shader &shader)
 
ShaderUnmanaged & SetValue (int uniformLoc, const ::Matrix &mat)
 Set shader uniform value (matrix 4x4)
 
ShaderUnmanaged & SetValue (int uniformLoc, const ::Texture2D &texture)
 Set shader uniform value for texture.
 
ShaderUnmanaged & SetValue (int uniformLoc, const void *value, int uniformType)
 Set shader uniform value.
 
ShaderUnmanaged & SetValue (int uniformLoc, const void *value, int uniformType, int count)
 Set shader uniform value vector.
 

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.
 
::Shader LoadFromMemory (const char *vsCode, const char *fsCode)
 
::Shader LoadFromMemory (const std::string &vsCode, const std::string &fsCode)
 Load a shader from memory.
 

Protected Member Functions

void set (const ::Shader &shader)
 

Detailed Description

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

Definition at line 15 of file ShaderUnmanaged.hpp.

Constructor & Destructor Documentation

◆ ShaderUnmanaged() [1/5]

raylib::ShaderUnmanaged::ShaderUnmanaged ( )
inline

Definition at line 17 of file ShaderUnmanaged.hpp.

◆ ShaderUnmanaged() [2/5]

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

Definition at line 19 of file ShaderUnmanaged.hpp.

◆ ShaderUnmanaged() [3/5]

raylib::ShaderUnmanaged::ShaderUnmanaged ( unsigned int  id,
int *  locs = nullptr 
)
inline

Definition at line 21 of file ShaderUnmanaged.hpp.

◆ ShaderUnmanaged() [4/5]

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

Definition at line 23 of file ShaderUnmanaged.hpp.

◆ ShaderUnmanaged() [5/5]

raylib::ShaderUnmanaged::ShaderUnmanaged ( const char *  vsFileName,
const char *  fsFileName 
)
inline

Definition at line 26 of file ShaderUnmanaged.hpp.

Member Function Documentation

◆ BeginMode()

ShaderUnmanaged & raylib::ShaderUnmanaged::BeginMode ( )
inline

Begin custom shader drawing.

Definition at line 63 of file ShaderUnmanaged.hpp.

◆ EndMode()

ShaderUnmanaged & raylib::ShaderUnmanaged::EndMode ( )
inline

End custom shader drawing (use default shader).

Definition at line 71 of file ShaderUnmanaged.hpp.

◆ 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 52 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 81 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 88 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 53 of file ShaderUnmanaged.hpp.

◆ IsValid()

bool raylib::ShaderUnmanaged::IsValid ( ) const
inline

Retrieves whether or not the shader is ready.

Definition at line 135 of file ShaderUnmanaged.hpp.

◆ Load() [1/2]

::Shader raylib::ShaderUnmanaged::Load ( const char *  vsFileName,
const char *  fsFileName 
)
inlinestatic

Definition at line 36 of file ShaderUnmanaged.hpp.

◆ Load() [2/2]

::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 33 of file ShaderUnmanaged.hpp.

◆ LoadFromMemory() [1/2]

::Shader raylib::ShaderUnmanaged::LoadFromMemory ( const char *  vsCode,
const char *  fsCode 
)
inlinestatic

Definition at line 48 of file ShaderUnmanaged.hpp.

◆ LoadFromMemory() [2/2]

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

Load a shader from memory.

See also
::LoadShaderFromMemory

Definition at line 45 of file ShaderUnmanaged.hpp.

◆ operator=()

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

Definition at line 55 of file ShaderUnmanaged.hpp.

◆ set()

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

Definition at line 137 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 117 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 127 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 97 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 107 of file ShaderUnmanaged.hpp.