source: trunk/src/lolgl.h @ 723

Last change on this file since 723 was 723, checked in by sam, 10 years ago

core: fix a few compilation errors and warnings on OS X.

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11//
12// The GL support
13// --------------
14//
15
16#if !defined __DH_LOLGL_H__
17#define __DH_LOLGL_H__
18
19#define GL_GLEXT_PROTOTYPES
20
21/* Only define one GL platform */
22#if defined HAVE_GL_1X
23#   undef HAVE_GLES_1X
24#endif
25#if defined HAVE_GLES_2X
26#   undef HAVE_GL_1X
27#   undef HAVE_GLES_1X
28#endif
29#if defined HAVE_GL_2X
30#   undef HAVE_GL_1X
31#   undef HAVE_GLES_1X
32#   undef HAVE_GLES_2X
33#endif
34
35/* Include GL */
36#if defined HAVE_GL_1X || defined HAVE_GL_2X
37#   if defined __APPLE__ && defined __MACH__
38#       include <OpenGL/gl.h>
39#   else
40#       define GL_GLEXT_PROTOTYPES
41#       include <GL/gl.h>
42#   endif
43#elif defined HAVE_GLES_1X
44#   if defined __APPLE__ && defined __MACH__
45#       include <OpenGLES/ES1/gl.h>
46#       include <OpenGLES/ES1/glext.h>
47#   else
48#       include <GLES/gl.h>
49#       include <GLES/glext.h>
50#   endif
51#elif defined HAVE_GLES_2X
52#   if defined __APPLE__ && defined __MACH__
53#       include <OpenGLES/ES2/gl.h>
54#       include <OpenGLES/ES2/glext.h>
55#   else
56#       include <GLES2/gl2.h>
57#       include <GLES2/gl2ext.h>
58#   endif
59#endif
60
61/* Redefine some function names */
62#if defined HAVE_GL_1X
63#   define glClearDepthf glClearDepth
64#elif defined HAVE_GL_2X
65#   define glClearDepthf glClearDepth
66#elif defined HAVE_GLES_1X
67#   define glGenVertexArrays glGenVertexArraysOES
68#   define glDeleteVertexArrays glDeleteVertexArraysOES
69#elif defined HAVE_GLES_2X
70#   define glGenVertexArrays glGenVertexArraysOES
71#   define glDeleteVertexArrays glDeleteVertexArraysOES
72#   define glBindVertexArray glBindVertexArrayOES
73#endif
74
75#endif // __DH_LOLGL_H__
76
Note: See TracBrowser for help on using the repository browser.