 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
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);
96 inline int GetLocation(
const std::string& uniformName)
const {
97 return ::GetShaderLocation(*
this, uniformName.c_str());
104 return ::GetShaderLocationAttrib(*
this, attribName.c_str());
110 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType) {
111 ::SetShaderValue(*
this, uniformLoc, value.c_str(), uniformType);
118 inline Shader&
SetValue(
int uniformLoc,
const std::string& value,
int uniformType,
int count) {
119 ::SetShaderValueV(*
this, uniformLoc, value.c_str(), uniformType, count);
127 ::SetShaderValueMatrix(*
this, uniformLoc, mat);
135 ::SetShaderValueTexture(*
this, uniformLoc, texture);
140 return ::GenTextureCubemap(*
this, panorama, size, format);
144 return ::GenTextureIrradiance(*
this, panorama, size);
148 return ::GenTexturePrefilter(*
this, panorama, size);
152 return ::GenTextureBRDF(*
this, size);
163 #endif // RAYLIB_CPP_INCLUDE_SHADER_HPP_
Provides all the classes associated with raylib-cpp.
::TextureCubemap GenTextureCubemap(::Texture2D panorama, int size, int format) const
Shader & SetValue(int uniformLoc, const std::string &value, int uniformType)
Set shader uniform value.
static Shader LoadCode(const std::string &vsCode, const std::string &fsCode)
Shader & BeginShaderMode()
::TextureCubemap GenTextureIrradiance(::Texture2D panorama, int size) const
int GetLocation(const std::string &uniformName) const
Get shader uniform location.
static Shader Load(const std::string &vsFileName, const std::string &fsFileName)
Shader & SetValue(int uniformLoc, ::Texture2D texture)
Set shader uniform value for texture.
Shader & operator=(const Shader &shader)
Shader & SetValue(int uniformLoc, const std::string &value, int uniformType, int count)
Shader(unsigned int Id, int *Locs)
Shader(const std::string &vsFileName, const std::string &fsFileName)
int GetLocationAttrib(const std::string &attribName) const
Get shader attribute location.
::Texture2D GenTextureBRDF(int size) const
Shader & SetValue(int uniformLoc, Matrix mat)
::TextureCubemap GenTexturePrefilter(::Texture2D panorama, int size) const
void set(::Shader shader)