2022-05-21 19:58:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include "StringBase.h"
|
|
|
|
|
|
|
|
namespace Assets
|
|
|
|
{
|
|
|
|
// Represents an OpenGL shader program.
|
|
|
|
class RenderShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RenderShader();
|
|
|
|
~RenderShader();
|
|
|
|
|
|
|
|
// Compiles the release shader, internal use only.
|
|
|
|
void LoadShader(const char* VertSource, const char* FragSource);
|
|
|
|
// Compiles the debug shader.
|
2022-05-21 21:51:35 +02:00
|
|
|
void LoadShader(const String& VertPath, const String& FragPath);
|
2022-05-21 19:58:09 +02:00
|
|
|
|
|
|
|
// Sets this shader as current.
|
|
|
|
void Use();
|
|
|
|
// Detatches the current shader.
|
|
|
|
void Detatch();
|
|
|
|
|
|
|
|
// Returns the uniform location for this shader.
|
|
|
|
uint32_t GetUniformLocation(const char* Name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
// Internal shader program id
|
|
|
|
uint32_t _ProgramID;
|
|
|
|
};
|
|
|
|
}
|