2023-05-01 12:55:49 +00:00
|
|
|
#ifndef ENGINE_INCLUDE_RESOURCES_SHADER_H_
|
|
|
|
#define ENGINE_INCLUDE_RESOURCES_SHADER_H_
|
2022-12-20 23:51:04 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
#include "application.hpp"
|
2022-12-20 23:51:04 +00:00
|
|
|
#include "gfx.hpp"
|
2023-05-01 12:55:49 +00:00
|
|
|
#include "gfx_device.hpp"
|
2022-12-20 23:51:04 +00:00
|
|
|
|
2023-01-08 15:22:44 +00:00
|
|
|
namespace engine {
|
2023-05-01 12:55:49 +00:00
|
|
|
namespace resources {
|
2022-12-20 23:51:04 +00:00
|
|
|
|
|
|
|
class Shader {
|
2023-05-01 12:55:49 +00:00
|
|
|
public:
|
|
|
|
// defines what vertex inputs are defined, position is always vec3
|
|
|
|
struct VertexParams {
|
|
|
|
bool has_normal; // vec3
|
|
|
|
bool has_tangent; // vec3
|
|
|
|
bool has_color; // vec3
|
|
|
|
bool has_uv0; // vec2
|
|
|
|
};
|
|
|
|
|
|
|
|
Shader(RenderData* render_data, const char* vert_path, const char* frag_path,
|
|
|
|
const VertexParams& vertex_params, bool alpha_blending,
|
|
|
|
bool cull_backface);
|
|
|
|
~Shader();
|
|
|
|
Shader(const Shader&) = delete;
|
|
|
|
Shader& operator=(const Shader&) = delete;
|
|
|
|
|
|
|
|
const gfx::Pipeline* GetPipeline();
|
|
|
|
|
|
|
|
private:
|
|
|
|
GFXDevice* const gfx_;
|
|
|
|
const gfx::Pipeline* pipeline_;
|
2022-12-20 23:51:04 +00:00
|
|
|
};
|
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
} // namespace resources
|
|
|
|
} // namespace engine
|
|
|
|
|
|
|
|
#endif
|