1 /*
2  * OpenBOR - http://www.LavaLit.com
3  * -----------------------------------------------------------------------
4  * All rights reserved, see LICENSE in OpenBOR root for details.
5  *
6  * Copyright (c) 2004 - 2011 OpenBOR Team
7  */
8 
9 #ifndef LOADGL_H
10 #define LOADGL_H
11 
12 #ifdef LOADGL
13 #undef GL_GLEXT_PROTOTYPES
14 #else
15 #define GL_GLEXT_PROTOTYPES
16 #endif
17 
18 #ifdef GLES
19 #include "SDL_opengles.h"
20 #elif WIN
21 // SDL_opengl.h in Windows includes <windows.h>, which clashes with several
22 // definitions in openbor.h :(
23 #define APIENTRY __stdcall
24 #include <GL/gl.h>
25 #include <GL/glext.h>
26 #else
27 #include "SDL_opengl.h"
28 #endif
29 
30 #ifdef LOADGL
31 // call this immediately after setting an OpenGL video mode in Linux or Windows
32 int LoadGLFunctions();
33 
34 extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
35 extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
36 extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
37 extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
38 extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
39 extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
40 extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
41 extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
42 extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
43 extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
44 extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
45 
46 #if WIN
47 // <GL/gl.h> in Windows only defines prototypes available in OpenGL 1.1, which
48 // is from 1995!  We define the function prototypes here for functions that
49 // became core in later revisions of the OpenGL API.  Currently this only
50 // includes multitexturing, which became core in OpenGL 1.3 (2001).
51 void APIENTRY glActiveTexture(GLenum texture);
52 void APIENTRY glMultiTexCoord2f(GLenum texture, GLfloat s, GLfloat t);
53 #endif // WIN
54 
55 #endif // LOADGL
56 
57 #endif // !defined(LOADGL_H)
58 
59