VMTK
shaders.h
1 /*
2  * shaders.h
3  *
4  * Copyright (C) 2013 Wu Shin-Ting, FEEC, Unicamp
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 #define FREEGLUT_STATIC
21 
22 #ifndef _shaders_h
23 #define _shaders_h
24 
25 #ifndef GLEW_STATIC
26 #define GLEW_STATIC
27 #endif
28 #ifdef __WIN32__
29 #include <GL/glew.h>
30 #elif __linux__
31 #include <GL/glew.h>
32 #elif __APPLE__
33 #include <glew.h>
34 #endif
35 
36 #include <GL/glut.h>
37 #include <iostream>
38 
39 class Shaders {
40  public:
41  GLuint carregueShaders(const char *vertexFileName, const char *fragmentFileName);
42 
43  private:
44  char *textFileRead(const char *fn);
45  int printOglError(char *file, int line);
46  void printShaderInfoLog(GLuint obj);
47  void printProgramInfoLog(GLuint obj);
48 
49 };
50 
51 #endif
52