1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_OGLTRANS_SHADERS_HXX_
25 #define INCLUDED_OGLTRANS_SHADERS_HXX_
26 
27 #define GL_GLEXT_PROTOTYPES 1
28 #include <GL/gl.h>
29 #include <GL/glext.h>
30 
31 class OGLShaders {
32     static bool Initialize();
33     static bool cbInitialized;
34 
35 public:
36 
37     static GLuint LinkProgram( const char *vertexShader, const char *fragmentShader );
38 
39     /** GL shader functions
40      */
41 #ifdef GL_VERSION_2_0
42 
43     static PFNGLCREATESHADERPROC glCreateShader;
44     static PFNGLSHADERSOURCEPROC glShaderSource;
45     static PFNGLCOMPILESHADERPROC glCompileShader;
46     static PFNGLGETSHADERIVPROC glGetShaderiv;
47     static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
48     static PFNGLDELETESHADERPROC glDeleteShader;
49 
50     static PFNGLCREATEPROGRAMPROC glCreateProgram;
51     static PFNGLATTACHSHADERPROC glAttachShader;
52     static PFNGLLINKPROGRAMPROC glLinkProgram;
53     static PFNGLGETPROGRAMIVPROC glGetProgramiv;
54     static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
55     static PFNGLUSEPROGRAMPROC glUseProgram;
56     static PFNGLDELETEPROGRAMPROC glDeleteProgram;
57 
58     static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
59     static PFNGLUNIFORM1IPROC glUniform1i;
60     static PFNGLUNIFORM1FPROC glUniform1f;
61 #endif
62 };
63 
64 #endif
65