* Material type (generic). * * The material will be unloaded on object destruction. Use raylib::MaterialUnmanaged if you're looking to not unload. * * @see raylib::MaterialUnmanaged */
| 12 | * @see raylib::MaterialUnmanaged |
| 13 | */ |
| 14 | class Material : public MaterialUnmanaged { |
| 15 | public: |
| 16 | using MaterialUnmanaged::MaterialUnmanaged; |
| 17 | |
| 18 | Material(const Material&) = delete; |
| 19 | Material& operator=(const Material&) = delete; |
| 20 | |
| 21 | Material(Material&& other) noexcept { |
| 22 | set(other); |
| 23 | other.maps = nullptr; |
| 24 | other.shader = {}; |
| 25 | other.params[0] = 0.0f; |
| 26 | other.params[1] = 0.0f; |
| 27 | other.params[2] = 0.0f; |
| 28 | other.params[3] = 0.0f; |
| 29 | } |
| 30 | |
| 31 | Material& operator=(Material&& other) noexcept { |
| 32 | if (this == &other) { |
| 33 | return *this; |
| 34 | } |
| 35 | Unload(); |
| 36 | set(other); |
| 37 | other.maps = nullptr; |
| 38 | other.shader = {}; |
| 39 | return *this; |
| 40 | } |
| 41 | |
| 42 | Material& operator=(const ::Material& material) { |
| 43 | Unload(); |
| 44 | set(material); |
| 45 | return *this; |
| 46 | } |
| 47 | |
| 48 | ~Material() { Unload(); } |
| 49 | }; |
| 50 | } // namespace raylib |
| 51 | |
| 52 | using RMaterial = raylib::Material; |
nothing calls this directly
no outgoing calls
no test coverage detected