/*********************************************************************
*                                                                    *          
*                              FLY                                   *
*                           --E#Y#E--				     *
*                         ===MUSCLE===                               *
*                                                                    *
*********************************************************************/
#ifndef UNIFORM_H_
#define UNIFORM_H_

/* C Header Files */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <math.h>
/* OpenGL */
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glu.h>
#include <GL/glext.h>
#include <GL/glxext.h>
/* Flysimulator */
#include "../CONF/config.h"

/*-------------------------------------------------------------------------*/

/* Create */
size_t ProgramSize(const GLchar* ShaderFile);
void createShader(const GLchar* vert, const GLchar* frag);
int compileShader(unsigned int shaderID);
void outputLog(unsigned int shaderID);
int createProgram(unsigned int shaderProgram); 
	
/* Uniform */
void Location(unsigned int shaderProgram, unsigned int location, const char* name);
void Uniform(unsigned int shaderProgram, const char* name ,const float matrix);
void Uniform4x4(unsigned int shaderProgram, const char* name, char transpose, const float* matrix);
void Uniform3x3(unsigned int shaderProgram, const char* name, char transpose, const float* matrix);
void sendUniform4f(unsigned int shaderProgram, const char* name, 
                  const float red, const float green, const float blue, const float alpha);
void sendUniform3f(unsigned int shaderProgram, const char* name, 
                  const float x, const float y, const float z);
void sendUniform(unsigned int shaderProgram, const char* name, const float scalar);                                  

/* Link and Bind */
void linkProgram(unsigned int shaderProgram);
void bindShader(unsigned int shaderProgram);
void DeleteShader(unsigned int shaderProgram);

/*-------------------------------------------------------------------------*/

#endif

