25 #ifndef RAYLIB_CPP_INCLUDE_SHADER_HPP_
26 #define RAYLIB_CPP_INCLUDE_SHADER_HPP_
30 #include "./raylib.hpp"
31 #include "./raylib-cpp-utils.hpp"
32 #include "Texture.hpp"
47 set(GetShaderDefault());
50 Shader(
const std::string& vsFileName,
const std::string& fsFileName) {
51 set(::LoadShader(vsFileName.c_str(), fsFileName.c_str()));
57 static ::Shader
Load(
const std::string& vsFileName,
const std::string& fsFileName) {
58 return ::LoadShader(vsFileName.c_str(), fsFileName.c_str());
64 static ::Shader
LoadCode(
const std::string& vsCode,
const std::string& fsCode) {
65 return ::LoadShaderCode(vsCode.c_str(), fsCode.c_str());
68 GETTERSETTER(
unsigned int, Id,
id)
69 GETTERSETTER(
int*, Locs, locs)
81 ::UnloadShader(*
this);
88 ::BeginShaderMode(*
this);
104 return ::GetShaderLocation(*
this, uniformName.c_str());
111 return ::GetShaderLocationAttrib(*
this, attribName.c_str());
119 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType) {
120 ::SetShaderValue(*
this, uniformLoc, value.c_str(), uniformType);
129 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType,
int count) {
130 ::SetShaderValueV(*
this, uniformLoc, value.c_str(), uniformType, count);
140 ::SetShaderValueMatrix(*
this, uniformLoc, mat);
150 ::SetShaderValueTexture(*
this, uniformLoc, texture);
155 return ::GenTextureCubemap(*
this, panorama, size, format);
159 return ::GenTextureIrradiance(*
this, panorama, size);
163 return ::GenTexturePrefilter(*
this, panorama, size);
167 return ::GenTextureBRDF(*
this, size);
171 inline void set(const ::Shader& shader) {
178 #endif // RAYLIB_CPP_INCLUDE_SHADER_HPP_