#include <Shader.h>
|
static int | initialize () |
|
static void | shutdown () |
|
static void | set2DState (bool on, bool depth=true) |
|
static void | drawGL (ShaderBuffer &vertices, ShaderBuffer &uvs, glm::vec4 color, unsigned int texture, TextureStorage store=TextureStorage::SYSTEM, unsigned int mode=GL_TRIANGLES, ShaderTexture *target=nullptr, Shader &shader=textShader) |
|
static void | drawGL (ShaderBuffer &vertices, ShaderBuffer &uvs, unsigned int texture, glm::mat4 MVP, TextureStorage store=TextureStorage::GAME, ShaderTexture *target=nullptr, Shader &shader=textureShader) |
|
static void | drawGL (ShaderBuffer &vertices, ShaderBuffer &uvs, ShaderBuffer &indices, unsigned int texture, glm::mat4 MVP, TextureStorage store=TextureStorage::GAME, ShaderTexture *target=nullptr, Shader &shader=textureShader) |
|
static void | drawGL (ShaderBuffer &vertices, ShaderBuffer &colors, glm::mat4 MVP, unsigned int mode=GL_TRIANGLES, ShaderTexture *target=nullptr, Shader &shader=colorShader) |
|
static void | drawGL (ShaderBuffer &vertices, ShaderBuffer &colors, ShaderBuffer &indices, glm::mat4 MVP, unsigned int mode=GL_TRIANGLES, ShaderTexture *target=nullptr, Shader &shader=colorShader) |
|
Definition at line 54 of file Shader.h.
int Shader::compile |
( |
const char * |
vertex, |
|
|
const char * |
fragment |
|
) |
| |
int Shader::addUniform |
( |
const char * |
name | ) |
|
unsigned int Shader::getUniform |
( |
int |
n | ) |
|
void Shader::loadUniform |
( |
int |
uni, |
|
|
glm::vec2 |
vec |
|
) |
| |
void Shader::loadUniform |
( |
int |
uni, |
|
|
glm::vec4 |
vec |
|
) |
| |
void Shader::loadUniform |
( |
int |
uni, |
|
|
glm::mat4 |
mat |
|
) |
| |
void Shader::loadUniform |
( |
int |
uni, |
|
|
int |
texture, |
|
|
TextureStorage |
store |
|
) |
| |
int Shader::initialize |
( |
| ) |
|
|
static |
void Shader::shutdown |
( |
| ) |
|
|
static |
void Shader::set2DState |
( |
bool |
on, |
|
|
bool |
depth = true |
|
) |
| |
|
static |
std::vector<unsigned int> Shader::uniforms |
|
private |
const char * Shader::textShaderVertex |
|
staticprivate |
Initial value:= R"!?!(
#version 330 core
layout(location = 0) in vec2 vertexPosition_screen;
layout(location = 1) in vec2 vertexUV;
out vec2 UV;
uniform vec2 screen;
void main() {
vec2 halfScreen = screen / 2;
vec2 vertexPosition_homogenous = (vertexPosition_screen - halfScreen) / halfScreen;
gl_Position = vec4(vertexPosition_homogenous.x, -vertexPosition_homogenous.y, 0, 1);
UV = vertexUV;
}
)!?!"
Definition at line 99 of file Shader.h.
const char * Shader::textShaderFragment |
|
staticprivate |
Initial value:= R"!?!(
#version 330 core
in vec2 UV;
layout(location = 0) out vec4 color;
uniform sampler2D textureSampler;
uniform vec4 colorVar;
void main() {
color = texture(textureSampler, UV) * colorVar;
}
)!?!"
Definition at line 100 of file Shader.h.
const char * Shader::textureShaderVertex |
|
staticprivate |
Initial value:= R"!?!(
#version 330 core
layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec2 vertexUV;
out vec2 UV;
uniform mat4 MVP;
void main() {
vec4 pos = MVP * vec4(vertexPosition_modelspace.x,
-vertexPosition_modelspace.y,
vertexPosition_modelspace.z,
1);
gl_Position = vec4(-pos.x, pos.yzw);
UV = vertexUV;
}
)!?!"
Definition at line 103 of file Shader.h.
const char * Shader::textureShaderFragment |
|
staticprivate |
Initial value:= R"!?!(
#version 330 core
in vec2 UV;
layout(location = 0) out vec4 color;
uniform sampler2D textureSampler;
void main() {
color = texture(textureSampler, UV);
}
)!?!"
Definition at line 104 of file Shader.h.
const char * Shader::colorShaderVertex |
|
staticprivate |
Initial value:= R"!?!(
#version 330 core
layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec3 vertexColor;
out vec3 color;
uniform mat4 MVP;
void main() {
vec4 pos = MVP * vec4(vertexPosition_modelspace.x,
-vertexPosition_modelspace.y,
vertexPosition_modelspace.z,
1);
gl_Position = vec4(-pos.x, pos.yzw);
color = vertexColor;
}
)!?!"
Definition at line 107 of file Shader.h.
const char * Shader::colorShaderFragment |
|
staticprivate |
Initial value:= R"!?!(
#version 330 core
in vec3 color;
layout(location = 0) out vec4 color_out;
void main() {
color_out = vec4(color, 1);
}
)!?!"
Definition at line 108 of file Shader.h.
unsigned int Shader::vertexArrayID = 0 |
|
staticprivate |
The documentation for this class was generated from the following files: