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.9KB

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