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.

185 lines
5.7KB

  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.7
  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_12_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_12_0
  73. #define GLES_SILENCE_DEPRECATION 1
  74. #endif
  75. #include <OpenGLES/ES3/gl.h>
  76. #elif JUCE_MAC
  77. #define JUCE_OPENGL3 1
  78. #if defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
  79. #define GL_SILENCE_DEPRECATION 1
  80. #endif
  81. #include <OpenGL/gl3.h>
  82. #include <OpenGL/gl3ext.h>
  83. #elif JUCE_ANDROID
  84. #include <android/native_window.h>
  85. #include <android/native_window_jni.h>
  86. #if JUCE_ANDROID_GL_ES_VERSION_3_0
  87. #define JUCE_OPENGL3 1
  88. #include <GLES3/gl3.h>
  89. #else
  90. #include <GLES2/gl2.h>
  91. #endif
  92. #include <EGL/egl.h>
  93. #endif
  94. #if GL_ES_VERSION_3_0
  95. #define JUCE_OPENGL3 1
  96. #endif
  97. //==============================================================================
  98. /** This macro is a helper for use in GLSL shader code which needs to compile on both OpenGL 2.1 and OpenGL 3.0.
  99. It's mandatory in OpenGL 3.0 to specify the GLSL version.
  100. */
  101. #if JUCE_OPENGL3
  102. #if JUCE_OPENGL_ES || OPENGL_ES
  103. #define JUCE_GLSL_VERSION "#version 300 es"
  104. #else
  105. #define JUCE_GLSL_VERSION "#version 150"
  106. #endif
  107. #else
  108. #define JUCE_GLSL_VERSION ""
  109. #endif
  110. //==============================================================================
  111. #if JUCE_OPENGL_ES || defined (DOXYGEN)
  112. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  113. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  114. these macros define the various precision keywords only on GLES.
  115. */
  116. #define JUCE_MEDIUMP "mediump"
  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_HIGHP "highp"
  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_LOWP "lowp"
  127. #else
  128. #define JUCE_MEDIUMP
  129. #define JUCE_HIGHP
  130. #define JUCE_LOWP
  131. #endif
  132. //==============================================================================
  133. namespace juce
  134. {
  135. class OpenGLTexture;
  136. class OpenGLFrameBuffer;
  137. class OpenGLShaderProgram;
  138. }
  139. #include "geometry/juce_Vector3D.h"
  140. #include "geometry/juce_Matrix3D.h"
  141. #include "geometry/juce_Quaternion.h"
  142. #include "geometry/juce_Draggable3DOrientation.h"
  143. #include "native/juce_MissingGLDefinitions.h"
  144. #include "opengl/juce_OpenGLHelpers.h"
  145. #include "opengl/juce_OpenGLPixelFormat.h"
  146. #include "native/juce_OpenGLExtensions.h"
  147. #include "opengl/juce_OpenGLRenderer.h"
  148. #include "opengl/juce_OpenGLContext.h"
  149. #include "opengl/juce_OpenGLFrameBuffer.h"
  150. #include "opengl/juce_OpenGLGraphicsContext.h"
  151. #include "opengl/juce_OpenGLImage.h"
  152. #include "opengl/juce_OpenGLShaderProgram.h"
  153. #include "opengl/juce_OpenGLTexture.h"
  154. #include "utils/juce_OpenGLAppComponent.h"