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.
 
 
 

55 lines
1.3 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 */
  22. #if defined HAVE_GL_2X
  23. # if defined __APPLE__ && defined __MACH__
  24. # include <OpenGL/gl.h>
  25. # else
  26. # define GL_GLEXT_PROTOTYPES
  27. # include <GL/gl.h>
  28. # endif
  29. #elif defined HAVE_GLES_2X
  30. # if defined __APPLE__ && defined __MACH__
  31. # include <OpenGLES/ES2/gl.h>
  32. # include <OpenGLES/ES2/glext.h>
  33. # else
  34. # include <GLES2/gl2.h>
  35. # include <GLES2/gl2ext.h>
  36. # endif
  37. #endif
  38. /* Redefine some function names */
  39. #if defined HAVE_GL_2X
  40. # define glClearDepthf glClearDepth
  41. #elif defined HAVE_GLES_2X
  42. # define glGenVertexArrays glGenVertexArraysOES
  43. # define glDeleteVertexArrays glDeleteVertexArraysOES
  44. # define glBindVertexArray glBindVertexArrayOES
  45. #endif
  46. #endif // __LOL_LOLGL_H__