You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

68 lines
1.8 KiB

  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. // The GL support
  12. // --------------
  13. //
  14. #if !defined __LOL_LOLGL_H__
  15. #define __LOL_LOLGL_H__
  16. #define GL_GLEXT_PROTOTYPES
  17. /* Only define one GL platform */
  18. #if defined HAVE_GL_2X
  19. # undef HAVE_GLES_2X
  20. #endif
  21. /* Include GL development headers.
  22. * Do not include glew.h on OS X, because the version shipped with Fink
  23. * links with X11 whereas we want the system’s Cocoa-friendly GL libs. */
  24. #if defined USE_GLEW && !defined __APPLE__
  25. # include <glew.h>
  26. #elif defined HAVE_GL_2X
  27. # if defined __APPLE__ && defined __MACH__ && defined __arm__
  28. # include <OpenGL/gl.h>
  29. # elif defined __APPLE__ && defined __MACH__
  30. # define MACOS_OPENGL
  31. # define GL_GLEXT_PROTOTYPES
  32. # include <OpenGL/OpenGL.h>
  33. # include <OpenGL/gl.h>
  34. # include <OpenGL/glext.h>
  35. # else
  36. # define GL_GLEXT_PROTOTYPES
  37. # include <GL/gl.h>
  38. # endif
  39. #elif defined HAVE_GLES_2X
  40. # if defined __APPLE__ && defined __MACH__
  41. # include <OpenGLES/ES2/gl.h>
  42. # include <OpenGLES/ES2/glext.h>
  43. # elif defined __CELLOS_LV2__
  44. # include <PSGL/psgl.h>
  45. # include <PSGL/psglu.h>
  46. # else
  47. # include <GLES2/gl2.h>
  48. # include <GLES2/gl2ext.h>
  49. # endif
  50. #endif
  51. /* Redefine some function names */
  52. #if defined HAVE_GL_2X
  53. #elif defined HAVE_GLES_2X
  54. # define glClearDepth glClearDepthf
  55. # define glGenVertexArrays glGenVertexArraysOES
  56. # define glDeleteVertexArrays glDeleteVertexArraysOES
  57. # define glBindVertexArray glBindVertexArrayOES
  58. #endif
  59. #endif // __LOL_LOLGL_H__