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 #ifndef GLES 35 extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB; 36 extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB; 37 extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB; 38 extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB; 39 extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB; 40 extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB; 41 extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB; 42 extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB; 43 extern PFNGLUNIFORM1IARBPROC glUniform1iARB; 44 extern PFNGLUNIFORM1FARBPROC glUniform1fARB; 45 extern PFNGLUNIFORM4FARBPROC glUniform4fARB; 46 #endif 47 48 #if WIN 49 // <GL/gl.h> in Windows only defines prototypes available in OpenGL 1.1, which 50 // is from 1995! We define the function prototypes here for functions that 51 // became core in later revisions of the OpenGL API. Currently this only 52 // includes multitexturing, which became core in OpenGL 1.3 (2001). 53 void APIENTRY glActiveTexture(GLenum texture); 54 void APIENTRY glMultiTexCoord2f(GLenum texture, GLfloat s, GLfloat t); 55 #endif // WIN 56 57 #endif // LOADGL 58 59 #endif // !defined(LOADGL_H) 60 61