summaryrefslogtreecommitdiff
path: root/themes/Shader.h
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-12-23 12:47:10 -0500
committermattkae <mattkae@protonmail.com>2022-12-23 12:47:10 -0500
commit7228b2e1a2d0a8399facce3493d71a3569d250d5 (patch)
tree8eb5e4b686bf68fa12fcbb270ef88dd29aa1d704 /themes/Shader.h
parentf63d0af456f76d713e56ca17be114fba0af22f6c (diff)
Improved the makefile considerably
Diffstat (limited to 'themes/Shader.h')
-rw-r--r--themes/Shader.h64
1 files changed, 0 insertions, 64 deletions
diff --git a/themes/Shader.h b/themes/Shader.h
deleted file mode 100644
index bc81764..0000000
--- a/themes/Shader.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#pragma once
-
-#include <GL/glew.h>
-#include <string>
-#include <vector>
-#include "mathlib.h"
-
-typedef GLuint Shader;
-
-Shader loadShader(const GLchar* vertexShader, const GLchar* fragmentShader);
-
-inline GLint getShaderUniform(const Shader& shader, const GLchar *name) {
- GLint uid = glGetUniformLocation(shader, name);
- if (uid < 0) {
- return -1;
- }
- return uid;
-}
-
-inline GLint getShaderAttribute(const Shader& shader, const GLchar *name) {
- printf("Getting attribute for shader, name: %d, %s\n", shader, name);
- GLint uid = glGetAttribLocation(shader, name);
- if (uid < 0) {
- printf("Unable to get attribute %s for shader %d\n", name, shader);
- return -1;
- }
- return uid;
-}
-
-inline void useShader(const Shader& shader) {
- glUseProgram(shader);
-}
-
-inline void setShaderFloat(GLint location, GLfloat value) {
- glUniform1f(location, value);
-}
-
-inline void setShaderInt(GLint location, GLint value) {
- glUniform1i(location, value);
-}
-
-inline void setShaderUint(GLint location, GLuint value) {
- glUniform1ui(location, value);
-}
-
-inline void setShaderVec2(GLint location, const Vector2& value) {
- glUniform2f(location, value.x, value.y);
-}
-
-inline void setShaderMat4(GLint location, const Mat4x4& matrix) {
- glUniformMatrix4fv(location, 1, GL_FALSE, matrix.m);
-}
-
-inline void setShaderBVec3(GLint location, bool first, bool second, bool third) {
- glUniform3i(location, first, second, third);
-}
-
-inline void setShaderBVec4(GLint location, bool first, bool second, bool third, bool fourth) {
- glUniform4i(location, first, second, third, fourth);
-}
-
-inline void setShaderBool(GLint location, bool value) {
- glUniform1i(location, value);
-}