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()));
54 static ::Shader
Load(
const std::string& vsFileName,
const std::string& fsFileName) {
55 return ::LoadShader(vsFileName.c_str(), fsFileName.c_str());
58 static ::Shader
LoadCode(
const std::string& vsCode,
const std::string& fsCode) {
59 return ::LoadShaderCode(vsCode.c_str(), fsCode.c_str());
62 GETTERSETTER(
unsigned int, Id,
id)
63 GETTERSETTER(
int*, Locs, locs)
80 ::UnloadShader(*
this);
84 ::BeginShaderMode(*
this);
96 inline int GetLocation(
const std::string& uniformName)
const {
97 return ::GetShaderLocation(*
this, uniformName.c_str());
104 return ::GetShaderLocationAttrib(*
this, attribName.c_str());
112 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType) {
113 ::SetShaderValue(*
this, uniformLoc, value.c_str(), uniformType);
122 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType,
int count) {
123 ::SetShaderValueV(*
this, uniformLoc, value.c_str(), uniformType, count);
133 ::SetShaderValueMatrix(*
this, uniformLoc, mat);
141 ::SetShaderValueTexture(*
this, uniformLoc, texture);
146 return ::GenTextureCubemap(*
this, panorama, size, format);
150 return ::GenTextureIrradiance(*
this, panorama, size);
154 return ::GenTexturePrefilter(*
this, panorama, size);
158 return ::GenTextureBRDF(*
this, size);
162 inline void set(const ::Shader& shader) {
169 #endif // RAYLIB_CPP_INCLUDE_SHADER_HPP_