2022-12-20 23:51:04 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "gfx.hpp"
|
|
|
|
|
2023-01-08 15:22:44 +00:00
|
|
|
namespace engine {
|
|
|
|
class GFXDevice;
|
|
|
|
}
|
2022-12-20 23:51:04 +00:00
|
|
|
|
|
|
|
namespace engine::resources {
|
|
|
|
|
|
|
|
class Shader {
|
|
|
|
|
|
|
|
public:
|
2023-01-02 17:24:20 +00:00
|
|
|
|
|
|
|
// defines what vertex inputs are defined, position is always vec3
|
|
|
|
struct VertexParams {
|
|
|
|
bool hasNormal;
|
|
|
|
bool hasUV0;
|
|
|
|
bool hasUV1;
|
|
|
|
bool hasUV2;
|
|
|
|
bool hasUV3;
|
|
|
|
bool hasTangent;
|
|
|
|
bool hasColor;
|
|
|
|
};
|
|
|
|
|
2023-01-08 15:22:44 +00:00
|
|
|
Shader(GFXDevice* gfx, const char* vertPath, const char* fragPath, const VertexParams& vertexParams, bool alphaBlending, bool cullBackFace);
|
|
|
|
~Shader();
|
2022-12-20 23:51:04 +00:00
|
|
|
Shader(const Shader&) = delete;
|
|
|
|
Shader& operator=(const Shader&) = delete;
|
|
|
|
|
2023-01-08 15:22:44 +00:00
|
|
|
const gfx::Pipeline* getPipeline();
|
2022-12-20 23:51:04 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
GFXDevice* const m_gfx;
|
|
|
|
const gfx::Pipeline* m_pipeline;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|