light/Engine/src/Platform/GraphicsAPI/OpenGL/glShader.hpp

30 lines
555 B
C++
Raw Normal View History

2021-05-27 19:54:05 +04:30
#pragma once
2022-03-08 21:19:19 +03:30
#include "Base/Base.hpp"
#include "Graphics/Shader.hpp"
#include "Utility/FileManager.hpp"
2022-03-04 22:40:20 +03:30
#include <shaderc/shaderc.hpp>
2021-05-27 19:54:05 +04:30
namespace Light {
2022-03-04 22:40:20 +03:30
class glShader: public Shader
{
private:
unsigned int m_ShaderID;
2021-05-27 19:54:05 +04:30
2022-03-04 22:40:20 +03:30
public:
glShader(BasicFileHandle vertexFile, BasicFileHandle pixelFile);
~glShader();
2021-05-27 19:54:05 +04:30
2022-03-04 22:40:20 +03:30
void Bind() override;
void UnBind() override;
2022-03-04 22:40:20 +03:30
private:
shaderc::SpvCompilationResult CompileGLSL(BasicFileHandle file, Shader::Stage stage);
2022-03-04 22:40:20 +03:30
unsigned int CompileShader(std::string source, Shader::Stage stage);
};
2021-05-27 19:54:05 +04:30
2022-03-04 22:40:20 +03:30
} // namespace Light