source: trunk/src/lolgl.h @ 680

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

Create the SdlApp class to avoid code duplication. Ensure USE_SDL is
tested wherever relevant.

  • Property svn:keywords set to Id
File size: 1.7 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/* Defines for exotic platforms (until they get their config.h) */
22#ifdef ANDROID_NDK
23#   define HAVE_GLES_1X
24#endif
25
26/* Only define one GL platform */
27#if defined HAVE_GL_1X
28#   undef HAVE_GLES_1X
29#endif
30#if defined HAVE_GLES_2X
31#   undef HAVE_GL_1X
32#   undef HAVE_GLES_1X
33#endif
34#if defined HAVE_GL_2X
35#   undef HAVE_GL_1X
36#   undef HAVE_GLES_1X
37#   undef HAVE_GLES_2X
38#endif
39
40/* Include GL */
41#if defined HAVE_GL_1X || defined HAVE_GL_2X
42#   if defined __APPLE__ && defined __MACH__
43#       include <OpenGL/gl.h>
44#   else
45#       define GL_GLEXT_PROTOTYPES
46#       include <GL/gl.h>
47#   endif
48#elif defined HAVE_GLES_1X
49#   include <GLES/gl.h>
50#   include <GLES/glext.h>
51#elif defined HAVE_GLES_2X
52#   include <GLES2/gl2.h>
53#   include <GLES2/gl2ext.h>
54#endif
55
56/* Redefine some function names */
57#if defined HAVE_GL_1X
58#   define glClearDepthf glClearDepth
59#elif defined HAVE_GL_2X
60#   define glClearDepthf glClearDepth
61#elif defined HAVE_GLES_1X
62#   define glGenVertexArrays glGenVertexArraysOES
63#   define glDeleteVertexArrays glDeleteVertexArraysOES
64#elif defined HAVE_GLES_2X
65#   define glGenVertexArrays glGenVertexArraysOES
66#   define glDeleteVertexArrays glDeleteVertexArraysOES
67#   define glBindVertexArray glBindVertexArrayOES
68#endif
69
70#endif // __DH_LOLGL_H__
71
Note: See TracBrowser for help on using the repository browser.