opengl

Sample code from LearnOpenGL.com
Log | Files | Refs

main.h (644B)


      1 typedef struct Shader {
      2 	unsigned int ID;
      3 } Shader;
      4 
      5 // Readfile read from file to a char* and return that pointer.
      6 // Caller is responsible to free the returned pointer.
      7 char *readfile(const char *file);
      8 // ShaderInit create Shader struct with vertexShader specified by vs and
      9 // fragmentShader specified by fs. vs and fs are path names to the shader
     10 // files. It returns the pointer to the resulting struct.
     11 Shader *ShaderInit(const char *vs, const char *fs);
     12 void ShaderUse(Shader *s);
     13 void ShaderDelete(Shader *s);
     14 void ShaderSetFloat(Shader *s, const char *name, float value);
     15 void ShaderSetMat4(Shader *s, const char *name, float *mat);
     16