engine/include/resources/shader.h

43 lines
1.0 KiB
C
Raw Normal View History

2023-11-05 01:04:05 +00:00
#pragma once
2022-12-20 23:51:04 +00:00
2023-05-01 13:13:35 +00:00
#include "application.h"
#include "gfx.h"
#include "gfx_device.h"
2022-12-20 23:51:04 +00:00
namespace engine {
2022-12-20 23:51:04 +00:00
class Shader {
2024-03-31 10:11:22 +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
};
struct ShaderSettings {
VertexParams vertexParams;
bool alpha_blending;
bool cull_backface;
bool write_z;
int render_order;
};
static constexpr int kHighestRenderOrder = 1;
Shader(Renderer* renderer, const std::string& vert_path, const std::string& frag_path, const ShaderSettings& settings);
~Shader();
Shader(const Shader&) = delete;
Shader& operator=(const Shader&) = delete;
const gfx::Pipeline* GetPipeline();
int GetRenderOrder() { return render_order_; }
private:
GFXDevice* const gfx_;
const gfx::Pipeline* pipeline_;
const int render_order_;
2022-12-20 23:51:04 +00:00
};
2024-03-31 10:11:22 +00:00
} // namespace engine