1 #ifndef RAYLIB_CPP_SHADER_HPP_
2 #define RAYLIB_CPP_SHADER_HPP_
12 #include "./raylib-cpp-utils.hpp"
13 #include "Texture.hpp"
28 set(GetShaderDefault());
31 GETTERSETTER(
unsigned int,Id,
id)
32 GETTERSETTER(
int*,Locs,locs)
49 ::UnloadShader(*
this);
52 static Shader Load(
const std::string& vsFileName,
const std::string& fsFileName) {
53 return ::LoadShader(vsFileName.c_str(), fsFileName.c_str());
55 static Shader LoadCode(
const std::string& vsCode,
const std::string& fsCode) {
56 char* param1 = (
char*)vsCode.c_str();
57 char* param2 = (
char*)fsCode.c_str();
58 return ::LoadShaderCode(param1, param2);
71 inline int GetLocation(
const std::string& uniformName)
const {
72 return ::GetShaderLocation(*
this, uniformName.c_str());
76 return ::GetShaderLocationAttrib(*
this, attribName.c_str());
79 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType) {
80 ::SetShaderValue(*
this, uniformLoc, value.c_str(), uniformType);
87 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType,
int count) {
88 ::SetShaderValueV(*
this, uniformLoc, value.c_str(), uniformType, count);
96 ::SetShaderValueMatrix(*
this, uniformLoc, mat);
104 ::SetShaderValueTexture(*
this, uniformLoc, texture);
109 return ::GenTextureCubemap(*
this, panorama, size, format);
113 return ::GenTextureIrradiance(*
this, panorama, size);
117 return ::GenTexturePrefilter(*
this, panorama, size);
121 return ::GenTextureBRDF(*
this, size);