mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 13:01:19 +00:00
36 lines
712 B
C++
36 lines
712 B
C++
|
#pragma once
|
||
|
|
||
|
#include "gfx.hpp"
|
||
|
#include "gfx_device.hpp"
|
||
|
|
||
|
#include <glm/mat4x4.hpp>
|
||
|
|
||
|
#include <string>
|
||
|
|
||
|
namespace engine::resources {
|
||
|
|
||
|
class Shader {
|
||
|
|
||
|
public:
|
||
|
Shader(GFXDevice* gfx, const char* vertPath, const char* fragPath, const gfx::VertexFormat& vertFormat, bool alphaBlending, bool cullBackFace)
|
||
|
: m_gfx(gfx)
|
||
|
{
|
||
|
m_pipeline = m_gfx->createPipeline(vertPath, fragPath, vertFormat, sizeof(glm::mat4), alphaBlending, cullBackFace);
|
||
|
}
|
||
|
~Shader()
|
||
|
{
|
||
|
m_gfx->destroyPipeline(m_pipeline);
|
||
|
}
|
||
|
Shader(const Shader&) = delete;
|
||
|
Shader& operator=(const Shader&) = delete;
|
||
|
|
||
|
const gfx::Pipeline* getPipeline() { return m_pipeline; }
|
||
|
|
||
|
private:
|
||
|
GFXDevice* const m_gfx;
|
||
|
const gfx::Pipeline* m_pipeline;
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|