ferx/engine/rendering/Shader.h

31 lines
661 B
C
Raw Normal View History

#pragma once
2024-07-31 13:40:16 +00:00
#define GLFW_INCLUDE_NONE
#include <glad/glad.h>
2024-07-31 13:40:16 +00:00
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <unordered_map>
2024-07-31 13:40:16 +00:00
class Shader
{
public:
Shader() = default;
Shader(const std::string& vPath, const std::string& fPath);
2024-07-31 13:40:16 +00:00
~Shader();
static Shader Create(const std::string& vPath, const std::string& fPath);
2024-07-31 13:40:16 +00:00
void Use() const;
void Shutdown() const;
int GetUniformLocation(const std::string& name);
2024-07-31 13:40:16 +00:00
private:
2024-08-28 12:38:19 +00:00
unsigned int m_ID{};
std::unordered_map<std::string, int> m_Uniforms{};
};