❖
Monad Engine
da02fba2
>
Undercity Codex
_
Loading...
Searching...
No Matches
ShaderProgram.h
Go to the documentation of this file.
1
#pragma once
2
#include <string>
3
#include <unordered_map>
4
#include <GL/glew.h>
5
#include <glm/mat4x4.hpp>
6
7
namespace
eng
8
{
9
class
Texture;
10
11
class
ShaderProgram
12
{
13
public
:
14
ShaderProgram
() =
delete
;
15
ShaderProgram
(
const
ShaderProgram
&) =
delete
;
16
ShaderProgram
&
operator=
(
const
ShaderProgram
&) =
delete
;
17
explicit
ShaderProgram
(
GLuint
shaderProgramID);
18
~ShaderProgram
();
19
20
void
Bind
();
21
GLint
GetUniformLocation
(
const
std::string& name);
22
void
SetUniform
(
const
std::string& name,
float
value);
23
void
SetUniform
(
const
std::string& name,
float
v0,
float
v1);
24
void
SetUniform
(
const
std::string& name,
const
glm::mat4& mat);
25
void
SetUniform
(
const
std::string& name,
const
glm::vec3& value);
26
void
SetUniform
(
const
std::string& name,
const
glm::vec4& value);
27
void
SetTexture
(
const
std::string& name,
Texture
* texture);
28
29
private
:
30
std::unordered_map<std::string, GLint> m_uniformLocationCache;
31
GLuint
m_shaderProgramID = 0;
32
int
m_currentTextureUnit = 0;
33
};
34
}
GLint
int GLint
Definition
GLForward.h:13
GLuint
unsigned int GLuint
Definition
GLForward.h:11
eng::ShaderProgram
Definition
ShaderProgram.h:12
eng::ShaderProgram::Bind
void Bind()
Definition
ShaderProgram.cpp:16
eng::ShaderProgram::GetUniformLocation
GLint GetUniformLocation(const std::string &name)
Definition
ShaderProgram.cpp:22
eng::ShaderProgram::ShaderProgram
ShaderProgram()=delete
eng::ShaderProgram::SetUniform
void SetUniform(const std::string &name, float value)
Definition
ShaderProgram.cpp:34
eng::ShaderProgram::ShaderProgram
ShaderProgram(const ShaderProgram &)=delete
eng::ShaderProgram::operator=
ShaderProgram & operator=(const ShaderProgram &)=delete
eng::ShaderProgram::SetTexture
void SetTexture(const std::string &name, Texture *texture)
Definition
ShaderProgram.cpp:64
eng::ShaderProgram::~ShaderProgram
~ShaderProgram()
Definition
ShaderProgram.cpp:11
eng::Texture
Definition
Texture.h:11
eng
Definition
Application.cpp:4
docs
GD-Engine-lesson-5-2
engine
source
graphics
ShaderProgram.h
Generated by
1.9.8