1 #ifndef RAYLIB_CPP_INCLUDE_SHADER_HPP_
2 #define RAYLIB_CPP_INCLUDE_SHADER_HPP_
6 #include "./raylib.hpp"
7 #include "./raylib-cpp-utils.hpp"
16 Shader(const ::Shader& shader) {
20 Shader(
unsigned int Id,
int* Locs) {
25 Shader(
const std::string& vsFileName,
const std::string& fsFileName) {
26 set(::LoadShader(vsFileName.c_str(), fsFileName.c_str()));
32 static ::Shader
Load(
const std::string& vsFileName,
const std::string& fsFileName) {
33 return ::LoadShader(vsFileName.c_str(), fsFileName.c_str());
36 static ::Shader LoadFromMemory(
const std::string& vsCode,
const std::string& fsCode) {
37 return ::LoadShaderFromMemory(vsCode.c_str(), fsCode.c_str());
40 GETTERSETTER(
unsigned int, Id,
id)
41 GETTERSETTER(
int*, Locs, locs)
54 ::UnloadShader(*
this);
62 ::BeginShaderMode(*
this);
79 inline int GetLocation(
const std::string& uniformName)
const {
80 return ::GetShaderLocation(*
this, uniformName.c_str());
89 return ::GetShaderLocationAttrib(*
this, attribName.c_str());
97 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType) {
98 ::SetShaderValue(*
this, uniformLoc, value.c_str(), uniformType);
107 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType,
int count) {
108 ::SetShaderValueV(*
this, uniformLoc, value.c_str(), uniformType, count);
118 ::SetShaderValueMatrix(*
this, uniformLoc, mat);
128 ::SetShaderValueTexture(*
this, uniformLoc, texture);
133 inline void set(const ::Shader& shader) {
140 #endif // RAYLIB_CPP_INCLUDE_SHADER_HPP_