Bomberman
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
RAY::Shader Class Reference

#include <Shaders.hpp>

Collaboration diagram for RAY::Shader:

Public Member Functions

const std::shared_ptr<::Shader > & getShaderPtr () const
 
void setShaderUniformVar (const std::string &varName, float value)
 The set var for float values. More...
 
void setShaderUniformVar (const std::string &varName, int value)
 The set var for float values. More...
 
void setShaderUniformVar (const std::string &varName, const RAY::Vector3 &vector)
 
void setLocation (::ShaderLocationIndex, const std::string &name)
 
 Shader (const std::string &vertexFile, const std::string &fragmentFile, bool lonely=false)
 ctor if no vertexfile in needed set it to nullptr More...
 
 Shader (const Shader &)=default
 Default copy ctor. More...
 
 ~Shader ()=default
 dtor More...
 
Shaderoperator= (const Shader &)=default
 Assignment operator. More...
 

Static Public Member Functions

static void BeginUsingCustomShader (RAY::Shader &shader)
 start using a custom shader when drawing More...
 
static void EndUsingCustomShader ()
 stop using the custom shader More...
 

Private Attributes

std::string _vertexFile
 The vertex file of the shader. More...
 
std::string _fragmentFile
 The fragment file of the shader. More...
 
std::shared_ptr<::Shader_rayLibShader
 Raylib shader struct. More...
 
std::map< std::string, int > _shaderIndexVars = {}
 Fetch and cache the index of the shader variable on the first set of the var. More...
 

Static Private Attributes

static Cache<::Shader_shadersCache
 

Constructor & Destructor Documentation

◆ Shader() [1/2]

RAY::Shader::Shader ( const std::string &  vertexFile,
const std::string &  fragmentFile,
bool  lonely = false 
)

ctor if no vertexfile in needed set it to nullptr

◆ Shader() [2/2]

RAY::Shader::Shader ( const Shader )
default

Default copy ctor.

◆ ~Shader()

RAY::Shader::~Shader ( )
default

dtor

Member Function Documentation

◆ BeginUsingCustomShader()

void RAY::Shader::BeginUsingCustomShader ( RAY::Shader shader)
static

start using a custom shader when drawing

◆ EndUsingCustomShader()

void RAY::Shader::EndUsingCustomShader ( )
static

stop using the custom shader

◆ getShaderPtr()

const std::shared_ptr<::Shader > & RAY::Shader::getShaderPtr ( ) const

◆ operator=()

Shader& RAY::Shader::operator= ( const Shader )
default

Assignment operator.

◆ setLocation()

void RAY::Shader::setLocation ( ::ShaderLocationIndex  ,
const std::string &  name 
)

◆ setShaderUniformVar() [1/3]

void RAY::Shader::setShaderUniformVar ( const std::string &  varName,
const RAY::Vector3 vector 
)

◆ setShaderUniformVar() [2/3]

void RAY::Shader::setShaderUniformVar ( const std::string &  varName,
float  value 
)

The set var for float values.

Note
Throw if the var is not found

◆ setShaderUniformVar() [3/3]

void RAY::Shader::setShaderUniformVar ( const std::string &  varName,
int  value 
)

The set var for float values.

Note
Throw if the var is not found

Member Data Documentation

◆ _fragmentFile

std::string RAY::Shader::_fragmentFile
private

The fragment file of the shader.

◆ _rayLibShader

std::shared_ptr<::Shader> RAY::Shader::_rayLibShader
private

Raylib shader struct.

◆ _shaderIndexVars

std::map<std::string, int> RAY::Shader::_shaderIndexVars = {}
private

Fetch and cache the index of the shader variable on the first set of the var.

◆ _shadersCache

Cache<::Shader > RAY::Shader::_shadersCache
staticprivate

◆ _vertexFile

std::string RAY::Shader::_vertexFile
private

The vertex file of the shader.


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