The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

131 lines
4.2KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_OPENGL_H_INCLUDED
  18. #define JUCE_OPENGL_H_INCLUDED
  19. #include "../juce_gui_extra/juce_gui_extra.h"
  20. #undef JUCE_OPENGL
  21. #define JUCE_OPENGL 1
  22. #if JUCE_IOS || JUCE_ANDROID
  23. #define JUCE_OPENGL_ES 1
  24. #endif
  25. #if JUCE_WINDOWS
  26. #ifndef APIENTRY
  27. #define APIENTRY __stdcall
  28. #define CLEAR_TEMP_APIENTRY 1
  29. #endif
  30. #ifndef WINGDIAPI
  31. #define WINGDIAPI __declspec(dllimport)
  32. #define CLEAR_TEMP_WINGDIAPI 1
  33. #endif
  34. #include <gl/GL.h>
  35. #ifdef CLEAR_TEMP_WINGDIAPI
  36. #undef WINGDIAPI
  37. #undef CLEAR_TEMP_WINGDIAPI
  38. #endif
  39. #ifdef CLEAR_TEMP_APIENTRY
  40. #undef APIENTRY
  41. #undef CLEAR_TEMP_APIENTRY
  42. #endif
  43. #elif JUCE_LINUX
  44. #include <GL/gl.h>
  45. #undef KeyPress
  46. #elif JUCE_IOS
  47. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
  48. #include <OpenGLES/ES3/gl.h>
  49. #else
  50. #include <OpenGLES/ES2/gl.h>
  51. #endif
  52. #elif JUCE_MAC
  53. #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
  54. #define JUCE_OPENGL3 1
  55. #include <OpenGL/gl3.h>
  56. #include <OpenGL/gl3ext.h>
  57. #else
  58. #include <OpenGL/gl.h>
  59. #include "OpenGL/glext.h"
  60. #endif
  61. #elif JUCE_ANDROID
  62. #include <GLES2/gl2.h>
  63. #endif
  64. //=============================================================================
  65. #if JUCE_OPENGL_ES || defined (DOXYGEN)
  66. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  67. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  68. these macros define the various precision keywords only on GLES.
  69. */
  70. #define JUCE_MEDIUMP "mediump"
  71. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  72. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  73. these macros define the various precision keywords only on GLES.
  74. */
  75. #define JUCE_HIGHP "highp"
  76. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  77. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  78. these macros define the various precision keywords only on GLES.
  79. */
  80. #define JUCE_LOWP "lowp"
  81. #else
  82. #define JUCE_MEDIUMP
  83. #define JUCE_HIGHP
  84. #define JUCE_LOWP
  85. #endif
  86. //=============================================================================
  87. namespace juce
  88. {
  89. class OpenGLTexture;
  90. class OpenGLFrameBuffer;
  91. class OpenGLShaderProgram;
  92. #include "native/juce_MissingGLDefinitions.h"
  93. #include "opengl/juce_OpenGLHelpers.h"
  94. #include "opengl/juce_Quaternion.h"
  95. #include "opengl/juce_Matrix3D.h"
  96. #include "opengl/juce_Draggable3DOrientation.h"
  97. #include "opengl/juce_OpenGLPixelFormat.h"
  98. #include "native/juce_OpenGLExtensions.h"
  99. #include "opengl/juce_OpenGLRenderer.h"
  100. #include "opengl/juce_OpenGLContext.h"
  101. #include "opengl/juce_OpenGLFrameBuffer.h"
  102. #include "opengl/juce_OpenGLGraphicsContext.h"
  103. #include "opengl/juce_OpenGLHelpers.h"
  104. #include "opengl/juce_OpenGLImage.h"
  105. #include "opengl/juce_OpenGLRenderer.h"
  106. #include "opengl/juce_OpenGLShaderProgram.h"
  107. #include "opengl/juce_OpenGLTexture.h"
  108. #include "opengl/juce_Vector3D.h"
  109. }
  110. #endif // JUCE_OPENGL_H_INCLUDED