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.

150 lines
4.7KB

  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 defined (__IPHONE_7_0) && __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. #if GL_ES_VERSION_3_0
  65. #define JUCE_OPENGL3 1
  66. #endif
  67. //=============================================================================
  68. /** This macro is a helper for use in GLSL shader code which needs to compile on both OpenGL 2.1 and OpenGL 3.0.
  69. It's mandatory in OpenGL 3.0 to specify the GLSL version.
  70. */
  71. #if JUCE_OPENGL3
  72. #if JUCE_OPENGL_ES
  73. #define JUCE_GLSL_VERSION "#version 300 es"
  74. #else
  75. #define JUCE_GLSL_VERSION "#version 150"
  76. #endif
  77. #else
  78. #define JUCE_GLSL_VERSION ""
  79. #endif
  80. //=============================================================================
  81. #if JUCE_OPENGL_ES || defined (DOXYGEN)
  82. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  83. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  84. these macros define the various precision keywords only on GLES.
  85. */
  86. #define JUCE_MEDIUMP "mediump"
  87. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  88. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  89. these macros define the various precision keywords only on GLES.
  90. */
  91. #define JUCE_HIGHP "highp"
  92. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  93. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  94. these macros define the various precision keywords only on GLES.
  95. */
  96. #define JUCE_LOWP "lowp"
  97. #else
  98. #define JUCE_MEDIUMP
  99. #define JUCE_HIGHP
  100. #define JUCE_LOWP
  101. #endif
  102. //=============================================================================
  103. namespace juce
  104. {
  105. class OpenGLTexture;
  106. class OpenGLFrameBuffer;
  107. class OpenGLShaderProgram;
  108. #include "geometry/juce_Quaternion.h"
  109. #include "geometry/juce_Matrix3D.h"
  110. #include "geometry/juce_Vector3D.h"
  111. #include "geometry/juce_Draggable3DOrientation.h"
  112. #include "native/juce_MissingGLDefinitions.h"
  113. #include "opengl/juce_OpenGLHelpers.h"
  114. #include "opengl/juce_OpenGLPixelFormat.h"
  115. #include "native/juce_OpenGLExtensions.h"
  116. #include "opengl/juce_OpenGLRenderer.h"
  117. #include "opengl/juce_OpenGLContext.h"
  118. #include "opengl/juce_OpenGLFrameBuffer.h"
  119. #include "opengl/juce_OpenGLGraphicsContext.h"
  120. #include "opengl/juce_OpenGLHelpers.h"
  121. #include "opengl/juce_OpenGLImage.h"
  122. #include "opengl/juce_OpenGLRenderer.h"
  123. #include "opengl/juce_OpenGLShaderProgram.h"
  124. #include "opengl/juce_OpenGLTexture.h"
  125. #include "utils/juce_OpenGLAppComponent.h"
  126. }
  127. #endif // JUCE_OPENGL_H_INCLUDED