1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#ifndef SHADERS_H
#define SHADERS_H
#include <GL/glew.h>
#include "../math/matrix4x4.h"
typedef struct
{
GLuint ID;
GLint position;
GLint color;
GLint uv;
GLint normal;
GLint totalTransform;
GLint modelToWorld;
GLint lightPosition;
GLint ambientLight;
GLint lightColor;
GLint lightAttenuation;
GLint World_eyePosition;
GLint Texture;
GLint Texture_Background;
GLint Texture_R;
GLint Texture_G;
GLint Texture_B;
GLint Texture_BlendMap;
} 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
|