Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gl_init.h
Go to the documentation of this file.
1 /*
2  * Vega Strike
3  * Copyright (C) 2001-2002 Daniel Horn
4  *
5  * http://vegastrike.sourceforge.net/
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 #ifndef _GL_INIT_H_
28 #define _GL_INIT_H_
29 
30 //#include "vegastrike.h"
31 
32 /* Hack to fix compiling problem with old gl.h's, reported by Steve
33  * Baker <sjbaker1@airmail.net>. Some old gl.h's don't include glext.h, but
34  * do this:
35  *
36  * #define GL_EXT_compiled_vertex_array 1
37  *
38  * since they do define the glLockArraysEXT/glUnlockArraysEXT
39  * functions. However, this prevents PFNGLLOCKARRAYSEXTPROC /
40  * PFNGLUNLOCKARRAYSEXTPROC from being defined in glext.h. So, we do
41  * the following, which at worst results in a warning (and is awfully
42  * ugly):
43  *
44  * #undef GL_EXT_compiled_vertex_array
45  *
46  * The *correct* thing to do would be for gl.h to #include glext.h, as
47  * recent gl.h's do. However, versions of Mesa as recent as 3.2.1
48  * don't do this, so we have to work around it.
49  */
50 //#undef GL_EXT_compiled_vertex_array
51 
52 /* Shouldn't need to include glext.h if gl.h is recent, but alas we can't
53  * count on that... */
54 
55 #if defined (IRIX)
56 #include <GL/gl.h>
57 #include <GL/glut.h>
58 typedef void (*PFNGLLOCKARRAYSEXTPROC)( GLint first, GLsizei count );
59 typedef void (*PFNGLUNLOCKARRAYSEXTPROC)( void );
60 
61 #elif !defined (_WIN32)
62 #if defined (__APPLE__) || defined (MACOSX)
63  #include <GLUT/glut.h>
64  #include <OpenGL/glext.h>
65 #else
66  #include <GL/glut.h>
67  #include <GL/glext.h>
68 #endif
69 
70 #if !defined (GL_GLEXT_VERSION) || GL_GLEXT_VERSION < 6
71 # error "*** You need a more recent copy of glext.h. You can get one at http: //oss.sgi.com/projects/ogl-sample/ABI/glext.h ; it goes in /usr/include/GL. ***"
72 #endif
73 #endif
74 #if defined (PFNGLLOCKARRAYSEXTPROC) && defined (PFNGLUNLOCKARRAYSEXTPROC)
75 extern PFNGLLOCKARRAYSEXTPROC glLockArraysEXT_p;
76 extern PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT_p;
77 #endif
78 
79 #ifdef __cplusplus
80 } /* extern "C" */
81 #endif
82 #endif
83