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.

182 lines
5.6KB

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