mirror of
https://github.com/kuhyx/engineer-thesis-WUT.git
synced 2026-07-04 18:43:04 +02:00
29 lines
1010 B
C++
29 lines
1010 B
C++
#ifndef SHADER_HPP
|
|
#define SHADER_HPP
|
|
#include <glad/glad.h>
|
|
|
|
#include <string>
|
|
#include <fstream>
|
|
#include <sstream>
|
|
#include <iostream>
|
|
|
|
class Shader
|
|
{
|
|
public:
|
|
// the program ID
|
|
unsigned int ID;
|
|
unsigned int linkShaderObjectsShaderProgram(const unsigned int vertexShaders, const unsigned int fragmentShader) const;
|
|
int shaderSuccessful(const unsigned int shader, const bool compilation) const;
|
|
unsigned int compileShader(const GLenum shaderType, const char *shaderSource) const;
|
|
const char *getSourceCode(const std::string_view sourcePath) const;
|
|
// constructor reads and builds the shader
|
|
Shader(const std::string_view vertexPath, const std::string_view fragmentPath);
|
|
// use/activate the shader
|
|
void use();
|
|
// utility uniform functions
|
|
void setBool(const std::string_view &name, const bool value) const;
|
|
void setInt(const std::string_view &name, const int value) const;
|
|
void setFloat(const std::string_view &name, const float value) const;
|
|
};
|
|
|
|
#endif |