source: trunk/src/lolgl.h @ 674

Last change on this file since 674 was 674, checked in by sam, 9 years ago

The engine now builds for GL and GL ES 1.x and 2.x, and runs for each
one except GL ES 2.x for now.

  • Property svn:keywords set to Id
File size: 1.6 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#   include <GLES/gl.h>
45#   include <GLES/glext.h>
46#elif defined HAVE_GLES_2X
47#   include <GLES2/gl2.h>
48#   include <GLES2/gl2ext.h>
49#endif
50
51/* Redefine some function names */
52#if defined HAVE_GL_1X
53#   define glClearDepthf glClearDepth
54#elif defined HAVE_GL_2X
55#   define glClearDepthf glClearDepth
56#elif defined HAVE_GLES_1X
57#   define glGenVertexArrays glGenVertexArraysOES
58#   define glDeleteVertexArrays glDeleteVertexArraysOES
59#elif defined HAVE_GLES_2X
60#   define glGenVertexArrays glGenVertexArraysOES
61#   define glDeleteVertexArrays glDeleteVertexArraysOES
62#   define glBindVertexArray glBindVertexArrayOES
63#endif
64
65#endif // __DH_LOLGL_H__
66
Note: See TracBrowser for help on using the repository browser.