light/modules/renderer/public/shader.hpp

42 lines
536 B
C++
Raw Normal View History

2025-07-05 13:28:41 +03:30
#pragma once
2025-07-10 21:51:17 +03:30
namespace Assets {
class TextAsset;
} // namespace Assets
2025-07-11 00:05:48 +03:30
namespace lt {
2025-07-05 13:28:41 +03:30
class SharedContext;
class Shader
{
public:
2025-07-10 21:51:17 +03:30
enum Stage : uint8_t
2025-07-05 13:28:41 +03:30
{
none = 0,
vertex,
pixel,
geometry,
2025-07-05 13:28:41 +03:30
};
2025-07-06 14:02:50 +03:30
static auto create(
2025-07-15 16:31:46 +03:30
const Ref<Assets::TextAsset> &vertex_asset,
const Ref<Assets::TextAsset> &pixel_asset,
const Ref<SharedContext> &shared_context
2025-07-06 14:02:50 +03:30
) -> Ref<Shader>;
2025-07-05 13:28:41 +03:30
virtual ~Shader() = default;
virtual void bind() = 0;
2025-07-05 16:07:51 +03:30
virtual void un_bind() = 0;
2025-07-05 13:28:41 +03:30
protected:
Shader() = default;
};
2025-07-11 00:05:48 +03:30
} // namespace lt