Files
raylib-cpp/include/raylib/Shader.hpp
Rob Loach e9860a8251 Update
2019-08-10 02:18:34 -04:00

56 lines
953 B
C++

#ifndef RAYLIB_CPP_VECTOR4_HPP_
#define RAYLIB_CPP_VECTOR4_HPP_
#include "raylib.h"
#include "utils.hpp"
namespace raylib {
class Shader : public ::Shader {
public:
Shader(::Shader shader) {
set(shader);
};
Shader(unsigned int Id, int* Locs) {
id = Id;
locs = Locs;
};
Shader() {
set(GetShaderDefault());
}
inline void set(::Shader shader) {
id = shader.id;
locs = shader.locs;
}
GETTERSETTER(unsigned int,Id,i)
~Shader() {
Unload();
}
void Unload() {
UnloadShader(*this);
}
static Shader Load(const std::string& vsFileName, const std::string& fsFileName) {
return LoadShader(vsFileName.c_str(), fsFileName.c_str());
}
static Shader LoadCode(const std::string& vsCode, const std::string& fsCode) {
return LoadShaderCode(vsCode.c_str(), fsCode.c_str());
}
void BeginShaderMode() {
BeginShaderMode(*this);
}
void EndShaderMode() {
EndShaderMode();
}
};
}
#endif