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.

189 lines
5.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. /*******************************************************************************
  20. The block below describes the properties of this module, and is read by
  21. the Projucer to automatically generate project code that uses it.
  22. For details about the syntax and how to create or use a module, see the
  23. JUCE Module Format.txt file.
  24. BEGIN_JUCE_MODULE_DECLARATION
  25. ID: juce_opengl
  26. vendor: juce
  27. version: 5.4.5
  28. name: JUCE OpenGL classes
  29. description: Classes for rendering OpenGL in a JUCE window.
  30. website: http://www.juce.com/juce
  31. license: GPL/Commercial
  32. dependencies: juce_gui_extra
  33. OSXFrameworks: OpenGL
  34. iOSFrameworks: OpenGLES
  35. linuxLibs: GL
  36. mingwLibs: opengl32
  37. END_JUCE_MODULE_DECLARATION
  38. *******************************************************************************/
  39. #pragma once
  40. #define JUCE_OPENGL_H_INCLUDED
  41. #include <juce_gui_extra/juce_gui_extra.h>
  42. #undef JUCE_OPENGL
  43. #define JUCE_OPENGL 1
  44. #if JUCE_IOS || JUCE_ANDROID
  45. #define JUCE_OPENGL_ES 1
  46. #endif
  47. #if JUCE_WINDOWS
  48. #ifndef APIENTRY
  49. #define APIENTRY __stdcall
  50. #define CLEAR_TEMP_APIENTRY 1
  51. #endif
  52. #ifndef WINGDIAPI
  53. #define WINGDIAPI __declspec(dllimport)
  54. #define CLEAR_TEMP_WINGDIAPI 1
  55. #endif
  56. #if JUCE_MINGW
  57. #include <GL/gl.h>
  58. #else
  59. #include <gl/GL.h>
  60. #endif
  61. #ifdef CLEAR_TEMP_WINGDIAPI
  62. #undef WINGDIAPI
  63. #undef CLEAR_TEMP_WINGDIAPI
  64. #endif
  65. #ifdef CLEAR_TEMP_APIENTRY
  66. #undef APIENTRY
  67. #undef CLEAR_TEMP_APIENTRY
  68. #endif
  69. #elif JUCE_LINUX
  70. #include <GL/gl.h>
  71. #undef KeyPress
  72. #elif JUCE_IOS
  73. #if defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
  74. #if defined (__IPHONE_12_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_12_0
  75. #define GLES_SILENCE_DEPRECATION 1
  76. #endif
  77. #include <OpenGLES/ES3/gl.h>
  78. #else
  79. #include <OpenGLES/ES2/gl.h>
  80. #endif
  81. #elif JUCE_MAC
  82. #define JUCE_OPENGL3 1
  83. #if defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
  84. #define GL_SILENCE_DEPRECATION 1
  85. #endif
  86. #include <OpenGL/gl3.h>
  87. #include <OpenGL/gl3ext.h>
  88. #elif JUCE_ANDROID
  89. #include <android/native_window.h>
  90. #include <android/native_window_jni.h>
  91. #if JUCE_ANDROID_GL_ES_VERSION_3_0
  92. #define JUCE_OPENGL3 1
  93. #include <GLES3/gl3.h>
  94. #else
  95. #include <GLES2/gl2.h>
  96. #endif
  97. #include <EGL/egl.h>
  98. #endif
  99. #if GL_ES_VERSION_3_0
  100. #define JUCE_OPENGL3 1
  101. #endif
  102. //==============================================================================
  103. /** This macro is a helper for use in GLSL shader code which needs to compile on both OpenGL 2.1 and OpenGL 3.0.
  104. It's mandatory in OpenGL 3.0 to specify the GLSL version.
  105. */
  106. #if JUCE_OPENGL3
  107. #if JUCE_OPENGL_ES
  108. #define JUCE_GLSL_VERSION "#version 300 es"
  109. #else
  110. #define JUCE_GLSL_VERSION "#version 150"
  111. #endif
  112. #else
  113. #define JUCE_GLSL_VERSION ""
  114. #endif
  115. //==============================================================================
  116. #if JUCE_OPENGL_ES || defined (DOXYGEN)
  117. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  118. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  119. these macros define the various precision keywords only on GLES.
  120. */
  121. #define JUCE_MEDIUMP "mediump"
  122. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  123. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  124. these macros define the various precision keywords only on GLES.
  125. */
  126. #define JUCE_HIGHP "highp"
  127. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  128. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  129. these macros define the various precision keywords only on GLES.
  130. */
  131. #define JUCE_LOWP "lowp"
  132. #else
  133. #define JUCE_MEDIUMP
  134. #define JUCE_HIGHP
  135. #define JUCE_LOWP
  136. #endif
  137. //==============================================================================
  138. namespace juce
  139. {
  140. class OpenGLTexture;
  141. class OpenGLFrameBuffer;
  142. class OpenGLShaderProgram;
  143. }
  144. #include "geometry/juce_Vector3D.h"
  145. #include "geometry/juce_Matrix3D.h"
  146. #include "geometry/juce_Quaternion.h"
  147. #include "geometry/juce_Draggable3DOrientation.h"
  148. #include "native/juce_MissingGLDefinitions.h"
  149. #include "opengl/juce_OpenGLHelpers.h"
  150. #include "opengl/juce_OpenGLPixelFormat.h"
  151. #include "native/juce_OpenGLExtensions.h"
  152. #include "opengl/juce_OpenGLRenderer.h"
  153. #include "opengl/juce_OpenGLContext.h"
  154. #include "opengl/juce_OpenGLFrameBuffer.h"
  155. #include "opengl/juce_OpenGLGraphicsContext.h"
  156. #include "opengl/juce_OpenGLImage.h"
  157. #include "opengl/juce_OpenGLShaderProgram.h"
  158. #include "opengl/juce_OpenGLTexture.h"
  159. #include "utils/juce_OpenGLAppComponent.h"