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.

187 lines
5.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI 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. /*******************************************************************************
  18. The block below describes the properties of this module, and is read by
  19. the Projucer to automatically generate project code that uses it.
  20. For details about the syntax and how to create or use a module, see the
  21. JUCE Module Format.txt file.
  22. BEGIN_JUCE_MODULE_DECLARATION
  23. ID: juce_opengl
  24. vendor: juce
  25. version: 4.2.2
  26. name: JUCE OpenGL classes
  27. description: Classes for rendering OpenGL in a JUCE window.
  28. website: http://www.juce.com/juce
  29. license: GPL/Commercial
  30. dependencies: juce_gui_extra
  31. OSXFrameworks: OpenGL
  32. iOSFrameworks: OpenGLES
  33. linuxLibs: GL
  34. mingwLibs: opengl32
  35. END_JUCE_MODULE_DECLARATION
  36. *******************************************************************************/
  37. #ifndef JUCE_OPENGL_H_INCLUDED
  38. #define JUCE_OPENGL_H_INCLUDED
  39. #include <juce_gui_extra/juce_gui_extra.h>
  40. #undef JUCE_OPENGL
  41. #define JUCE_OPENGL 1
  42. #if JUCE_IOS || JUCE_ANDROID
  43. #define JUCE_OPENGL_ES 1
  44. #endif
  45. #if JUCE_WINDOWS
  46. #ifndef APIENTRY
  47. #define APIENTRY __stdcall
  48. #define CLEAR_TEMP_APIENTRY 1
  49. #endif
  50. #ifndef WINGDIAPI
  51. #define WINGDIAPI __declspec(dllimport)
  52. #define CLEAR_TEMP_WINGDIAPI 1
  53. #endif
  54. #if JUCE_MINGW
  55. #include <GL/gl.h>
  56. #else
  57. #include <gl/GL.h>
  58. #endif
  59. #ifdef CLEAR_TEMP_WINGDIAPI
  60. #undef WINGDIAPI
  61. #undef CLEAR_TEMP_WINGDIAPI
  62. #endif
  63. #ifdef CLEAR_TEMP_APIENTRY
  64. #undef APIENTRY
  65. #undef CLEAR_TEMP_APIENTRY
  66. #endif
  67. #elif JUCE_LINUX
  68. #include <GL/gl.h>
  69. #undef KeyPress
  70. #elif JUCE_IOS
  71. #if defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
  72. #include <OpenGLES/ES3/gl.h>
  73. #else
  74. #include <OpenGLES/ES2/gl.h>
  75. #endif
  76. #elif JUCE_MAC
  77. #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
  78. #define JUCE_OPENGL3 1
  79. #include <OpenGL/gl3.h>
  80. #include <OpenGL/gl3ext.h>
  81. #else
  82. #include <OpenGL/gl.h>
  83. #include <OpenGL/glext.h>
  84. #endif
  85. #elif JUCE_ANDROID
  86. #include <android/native_window.h>
  87. #include <android/native_window_jni.h>
  88. #include <GLES2/gl2.h>
  89. #include <EGL/egl.h>
  90. #endif
  91. #if GL_ES_VERSION_3_0
  92. #define JUCE_OPENGL3 1
  93. #endif
  94. //==============================================================================
  95. /** This macro is a helper for use in GLSL shader code which needs to compile on both OpenGL 2.1 and OpenGL 3.0.
  96. It's mandatory in OpenGL 3.0 to specify the GLSL version.
  97. */
  98. #if JUCE_OPENGL3
  99. #if JUCE_OPENGL_ES
  100. #define JUCE_GLSL_VERSION "#version 300 es"
  101. #else
  102. #define JUCE_GLSL_VERSION "#version 150"
  103. #endif
  104. #else
  105. #define JUCE_GLSL_VERSION ""
  106. #endif
  107. //==============================================================================
  108. #if JUCE_OPENGL_ES || defined (DOXYGEN)
  109. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  110. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  111. these macros define the various precision keywords only on GLES.
  112. */
  113. #define JUCE_MEDIUMP "mediump"
  114. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  115. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  116. these macros define the various precision keywords only on GLES.
  117. */
  118. #define JUCE_HIGHP "highp"
  119. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  120. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  121. these macros define the various precision keywords only on GLES.
  122. */
  123. #define JUCE_LOWP "lowp"
  124. #else
  125. #define JUCE_MEDIUMP
  126. #define JUCE_HIGHP
  127. #define JUCE_LOWP
  128. #endif
  129. //==============================================================================
  130. namespace juce
  131. {
  132. class OpenGLTexture;
  133. class OpenGLFrameBuffer;
  134. class OpenGLShaderProgram;
  135. #include "geometry/juce_Quaternion.h"
  136. #include "geometry/juce_Matrix3D.h"
  137. #include "geometry/juce_Vector3D.h"
  138. #include "geometry/juce_Draggable3DOrientation.h"
  139. #include "native/juce_MissingGLDefinitions.h"
  140. #include "opengl/juce_OpenGLHelpers.h"
  141. #include "opengl/juce_OpenGLPixelFormat.h"
  142. #include "native/juce_OpenGLExtensions.h"
  143. #include "opengl/juce_OpenGLRenderer.h"
  144. #include "opengl/juce_OpenGLContext.h"
  145. #include "opengl/juce_OpenGLFrameBuffer.h"
  146. #include "opengl/juce_OpenGLGraphicsContext.h"
  147. #include "opengl/juce_OpenGLHelpers.h"
  148. #include "opengl/juce_OpenGLImage.h"
  149. #include "opengl/juce_OpenGLRenderer.h"
  150. #include "opengl/juce_OpenGLShaderProgram.h"
  151. #include "opengl/juce_OpenGLTexture.h"
  152. #include "utils/juce_OpenGLAppComponent.h"
  153. }
  154. #endif // JUCE_OPENGL_H_INCLUDED