NS/main/source/util/ShaderUtil.h
pierow 8ab1a69972 add postprocessing
- add GLSL postprocessing shader to world view and have it replicate the old gamma ramp
- clear framebuffer between frames to fix visual bugs outside map
- remove old gamma ramp code (was disabled) and remove gamma adjustments to hud elements as they're now unaffected by the shader
- additional visual preset config updates
2024-02-28 22:36:49 -05:00

33 lines
830 B
C++

#pragma once
#include <string>
// Utitlity class to load, compile and attach a vertex- and fragment shader to a program
class ShaderUtil
{
private:
unsigned int mProgramId;
//unsigned int GetCompiledShader(unsigned int shader_type, const std::string& shader_source, const std::string& path);
unsigned int GetCompiledShader(unsigned int shader_type, const std::string& shader_source);
public:
ShaderUtil() {}
~ShaderUtil() {}
// Load a vertex and a fragment shader from file
//bool LoadFromFile(const std::string& vertexShaderFile, const std::string& fragmentShaderFile);
bool LoadFromString(const std::string& vertexShader, const std::string& fragmentShader);
// Use the program
void Use();
// Delete the program
void Delete();
// Give the programID
unsigned int GetProgramID() { return mProgramId; }
};