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.

188 lines
5.7KB

  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.1.2
  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. #include <OpenGLES/ES3/gl.h>
  75. #else
  76. #include <OpenGLES/ES2/gl.h>
  77. #endif
  78. #elif JUCE_MAC
  79. #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
  80. #define JUCE_OPENGL3 1
  81. #include <OpenGL/gl3.h>
  82. #include <OpenGL/gl3ext.h>
  83. #else
  84. #include <OpenGL/gl.h>
  85. #include <OpenGL/glext.h>
  86. #endif
  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"