SDL_opengl.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 Sam Lantinga <[email protected]>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_opengl.h
  20. *
  21. * This is a simple file to encapsulate the OpenGL API headers.
  22. */
  23. #ifndef _SDL_opengl_h
  24. #define _SDL_opengl_h
  25. #include "SDL_config.h"
  26. #ifndef __IPHONEOS__
  27. #ifdef __WIN32__
  28. #ifndef WIN32_LEAN_AND_MEAN
  29. #define WIN32_LEAN_AND_MEAN
  30. #endif
  31. #ifndef NOMINMAX
  32. #define NOMINMAX /* Don't defined min() and max() */
  33. #endif
  34. #include <windows.h>
  35. #endif
  36. #ifdef __glext_h_
  37. /* Someone has already included glext.h */
  38. #define NO_SDL_GLEXT
  39. #endif
  40. #ifndef NO_SDL_GLEXT
  41. #define __glext_h_ /* Don't let gl.h include glext.h */
  42. #endif
  43. #if defined(__MACOSX__)
  44. #include <stddef.h> /* Needed for ptrdiff_t */
  45. /* Hack to prevent duplicate definition of GLsizeiptrARB and GLintptrARB in <OpenGL/gltypes.h> */
  46. #define GL_ARB_vertex_buffer_object 1
  47. #include <OpenGL/gl.h> /* Header File For The OpenGL Library */
  48. #undef GL_ARB_vertex_buffer_object
  49. #define __X_GL_H
  50. #else
  51. #include <GL/gl.h> /* Header File For The OpenGL Library */
  52. #endif
  53. #ifndef NO_SDL_GLEXT
  54. #undef __glext_h_
  55. #endif
  56. /**
  57. * \file SDL_opengl.h
  58. *
  59. * This file is included because glext.h is not available on some systems.
  60. * If you don't want this version included, simply define ::NO_SDL_GLEXT.
  61. *
  62. * The latest version is available from:
  63. * http://www.opengl.org/registry/
  64. */
  65. /**
  66. * \def NO_SDL_GLEXT
  67. *
  68. * Define this if you have your own version of glext.h and want to disable the
  69. * version included in SDL_opengl.h.
  70. */
  71. #if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY)
  72. #include "SDL_opengl_glext.h"
  73. #endif /* NO_SDL_GLEXT */
  74. #endif /* !__IPHONEOS__ */
  75. #endif /* _SDL_opengl_h */
  76. /* vi: set ts=4 sw=4 expandtab: */