Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOOpenGLOnly.h
Go to the documentation of this file.
1/*
2
3OOOpenGL.h
4
5Do whatever is appropriate to get gl.h, glu.h and glext.h included.
6
7
8Oolite
9Copyright (C) 2004-2013 Giles C Williams and contributors
10
11This program is free software; you can redistribute it and/or
12modify it under the terms of the GNU General Public License
13as published by the Free Software Foundation; either version 2
14of the License, or (at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
22along with this program; if not, write to the Free Software
23Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24MA 02110-1301, USA.
25
26*/
27
28#ifndef OOLITE_SDL
29#if (!OOLITE_MAC_OS_X && GNUSTEP)
30#define OOLITE_SDL 1
31#endif
32#endif
33
34#if OOLITE_MAC_OS_X
35
36// Apple OpenGL includes...
37#include <OpenGL/OpenGL.h>
38#include <OpenGL/gl.h>
39#include <OpenGL/glu.h>
40#include <OpenGL/glext.h>
41
42#elif OOLITE_SDL
43
44// SDL OpenGL includes...
45
46// prevent the including of SDL_opengl.h loading a previous version of glext.h
47#define NO_SDL_GLEXT
48
49// GL_GLEXT_PROTOTYPES must be defined for the Linux build to use shaders.
50#if OOLITE_LINUX
51#ifndef GL_GLEXT_PROTOTYPES
52#define GL_GLEXT_PROTOTYPES
53#define __DEFINED_GL_GLEXT_PROTOTYPES
54#endif // GL_GLEXT_PROTOTYPES
55#endif // OOLITE_LINUX && !OOLITE_WINDOWS
56
57// the standard SDL_opengl.h
58#include <SDL_opengl.h>
59
60// include an up-to-date version of glext.h
61#include <GL/glext.h>
62
63#ifdef __DEFINED_GL_GLEXT_PROTOTYPES
64#undef GL_GLEXT_PROTOTYPES
65#undef __DEFINED_GL_GLEXT_PROTOTYPES
66#endif
67
68#else // Not OS X or SDL
69
70#error OOOpenGL.h: unknown target!
71
72#endif