diff options
| author | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-01-16 23:02:32 +0100 |
|---|---|---|
| committer | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-01-16 23:02:32 +0100 |
| commit | 6b8af9cf83851c075c6c9514b1deaa931c2b19a4 (patch) | |
| tree | 428986b49c32e21d3f7a3c2dfa41858ae0153209 /08-august/src/graphics/shaders.h | |
Initial commit
Diffstat (limited to '08-august/src/graphics/shaders.h')
| -rw-r--r-- | 08-august/src/graphics/shaders.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/08-august/src/graphics/shaders.h b/08-august/src/graphics/shaders.h new file mode 100644 index 0000000..db090fd --- /dev/null +++ b/08-august/src/graphics/shaders.h @@ -0,0 +1,51 @@ +#ifndef SHADERS_H +#define SHADERS_H + +#include <GL/glew.h> + +#include "../math/matrix4x4.h" + +typedef struct +{ + /* Program ID */ + GLuint ID; + + /* Program Attributes */ + GLint position; + GLint color; + GLint uv; + GLint normal; + + /* Program Uniforms */ + GLint totalTransform; + GLint modelToWorld; + GLint lightPosition; + GLint ambientLight; + GLint lightColor; + GLint lightAttenuation; + GLint World_eyePosition; + GLint Texture; + GLint Normal_Map; + + /* Program Multi Purpose Uniforms */ + GLint extra0; + GLint extra1; + GLint extra2; + GLint extra3; + GLint extra4; + GLint extra5; +} Shader_Layout; + +extern GLuint Shader_CompileShaders(const char* vertexShader, const char* fragmentShader); +extern GLint Shader_GetUniformLocation( GLuint programID, const char* uniformName ); +extern GLint Shader_GetAttribLocation ( GLuint programID, const char* attributeName ); +extern void Shader_Destroy(GLuint programID); + +extern void Shader_SetUniformMat4( GLuint programID, const char* name, const float *matrix ); +extern void Shader_SetUniformFloat( GLuint programID, const char* name, const float val ); +extern void Shader_SetUniformVec2( GLuint programID, const char* name, const float vec[2] ); +extern void Shader_SetUniformVec3( GLuint programID, const char* name, const float vec[3] ); +extern void Shader_SetUniformVec4( GLuint programID, const char* name, const float vec[4] ); +extern void Shader_SetUniformInt( GLuint programID, const char* name, const int val ); + +#endif // SHADERS_H |
