Toast Engine
Loading...
Searching...
No Matches
shader.hpp
Go to the documentation of this file.
1
8
9#pragma once
10#include "core_types.hpp"
11
12namespace assets {
13
14class TOAST_API Shader : public Asset {
15public:
16 explicit Shader(std::vector<uint8_t> data) : m_source(reinterpret_cast<const char*>(data.data()), data.size()) { }
17
18 [[nodiscard]]
19 auto type() const -> std::string_view override {
20 return "shader";
21 }
22
23 [[nodiscard]]
24 auto source() const noexcept -> const std::string& {
25 return m_source;
26 }
27
29 void setSource(std::vector<uint8_t> data) noexcept { m_source.assign(reinterpret_cast<const char*>(data.data()), data.size()); }
30
31private:
32 std::string m_source;
33};
34
35}
void setSource(std::vector< uint8_t > data) noexcept
Replaces the source in place on hot reload.
Definition shader.hpp:29
Base types for the asset system.