Files
Alex Lardner d7890c9808 init commit
2026-07-04 19:08:19 -07:00

54 lines
984 B
C++

#ifndef RAYLIB_CPP_INCLUDE_SHADER_HPP_
#define RAYLIB_CPP_INCLUDE_SHADER_HPP_
#include <string>
#include "ShaderUnmanaged.hpp"
#include "Texture.hpp"
#include "./raylib-cpp-utils.hpp"
#include "./raylib.hpp"
namespace raylib {
/**
* Shader type (generic)
*/
class Shader : public ShaderUnmanaged {
public:
using ShaderUnmanaged::ShaderUnmanaged;
Shader(const Shader&) = delete;
Shader(Shader&& other) noexcept {
set(other);
other.id = 0;
other.locs = nullptr;
}
Shader& operator=(const Shader&) = delete;
Shader& operator=(Shader&& other) noexcept {
if (this == &other) {
return *this;
}
Unload();
set(other);
other.id = 0;
other.locs = nullptr;
return *this;
}
/**
* Unload shader from GPU memory (VRAM)
*/
~Shader() { Unload(); }
};
} // namespace raylib
using RShader = raylib::Shader;
#endif // RAYLIB_CPP_INCLUDE_SHADER_HPP_