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