1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_OGLTRANS_SHADERS_HXX_
29 #define INCLUDED_OGLTRANS_SHADERS_HXX_
30 
31 #define GL_GLEXT_PROTOTYPES 1
32 #include <GL/gl.h>
33 #include <GL/glext.h>
34 
35 class OGLShaders {
36     static bool Initialize();
37     static bool cbInitialized;
38 
39 public:
40 
41     static GLuint LinkProgram( const char *vertexShader, const char *fragmentShader );
42 
43     /** GL shader functions
44      */
45 #ifdef GL_VERSION_2_0
46 
47     static PFNGLCREATESHADERPROC glCreateShader;
48     static PFNGLSHADERSOURCEPROC glShaderSource;
49     static PFNGLCOMPILESHADERPROC glCompileShader;
50     static PFNGLGETSHADERIVPROC glGetShaderiv;
51     static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
52     static PFNGLDELETESHADERPROC glDeleteShader;
53 
54     static PFNGLCREATEPROGRAMPROC glCreateProgram;
55     static PFNGLATTACHSHADERPROC glAttachShader;
56     static PFNGLLINKPROGRAMPROC glLinkProgram;
57     static PFNGLGETPROGRAMIVPROC glGetProgramiv;
58     static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
59     static PFNGLUSEPROGRAMPROC glUseProgram;
60     static PFNGLDELETEPROGRAMPROC glDeleteProgram;
61 
62     static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
63     static PFNGLUNIFORM1IPROC glUniform1i;
64     static PFNGLUNIFORM1FPROC glUniform1f;
65 #endif
66 };
67 
68 #endif
69