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.

154 lines
4.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_OPENGL_H_INCLUDED
  18. #define JUCE_OPENGL_H_INCLUDED
  19. #include "../juce_gui_extra/juce_gui_extra.h"
  20. #undef JUCE_OPENGL
  21. #define JUCE_OPENGL 1
  22. #if JUCE_IOS || JUCE_ANDROID
  23. #define JUCE_OPENGL_ES 1
  24. #endif
  25. #if ! JUCE_ANDROID
  26. #define JUCE_OPENGL_CREATE_JUCE_RENDER_THREAD 1
  27. #endif
  28. #if JUCE_WINDOWS
  29. #ifndef APIENTRY
  30. #define APIENTRY __stdcall
  31. #define CLEAR_TEMP_APIENTRY 1
  32. #endif
  33. #ifndef WINGDIAPI
  34. #define WINGDIAPI __declspec(dllimport)
  35. #define CLEAR_TEMP_WINGDIAPI 1
  36. #endif
  37. #include <gl/GL.h>
  38. #ifdef CLEAR_TEMP_WINGDIAPI
  39. #undef WINGDIAPI
  40. #undef CLEAR_TEMP_WINGDIAPI
  41. #endif
  42. #ifdef CLEAR_TEMP_APIENTRY
  43. #undef APIENTRY
  44. #undef CLEAR_TEMP_APIENTRY
  45. #endif
  46. #elif JUCE_LINUX
  47. #include <GL/gl.h>
  48. #undef KeyPress
  49. #elif JUCE_IOS
  50. #if defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
  51. #include <OpenGLES/ES3/gl.h>
  52. #else
  53. #include <OpenGLES/ES2/gl.h>
  54. #endif
  55. #elif JUCE_MAC
  56. #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
  57. #define JUCE_OPENGL3 1
  58. #include <OpenGL/gl3.h>
  59. #include <OpenGL/gl3ext.h>
  60. #else
  61. #include <OpenGL/gl.h>
  62. #include <OpenGL/glext.h>
  63. #endif
  64. #elif JUCE_ANDROID
  65. #include <GLES2/gl2.h>
  66. #endif
  67. #if GL_ES_VERSION_3_0
  68. #define JUCE_OPENGL3 1
  69. #endif
  70. //=============================================================================
  71. /** This macro is a helper for use in GLSL shader code which needs to compile on both OpenGL 2.1 and OpenGL 3.0.
  72. It's mandatory in OpenGL 3.0 to specify the GLSL version.
  73. */
  74. #if JUCE_OPENGL3
  75. #if JUCE_OPENGL_ES
  76. #define JUCE_GLSL_VERSION "#version 300 es"
  77. #else
  78. #define JUCE_GLSL_VERSION "#version 150"
  79. #endif
  80. #else
  81. #define JUCE_GLSL_VERSION ""
  82. #endif
  83. //=============================================================================
  84. #if JUCE_OPENGL_ES || defined (DOXYGEN)
  85. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  86. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  87. these macros define the various precision keywords only on GLES.
  88. */
  89. #define JUCE_MEDIUMP "mediump"
  90. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  91. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  92. these macros define the various precision keywords only on GLES.
  93. */
  94. #define JUCE_HIGHP "highp"
  95. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  96. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  97. these macros define the various precision keywords only on GLES.
  98. */
  99. #define JUCE_LOWP "lowp"
  100. #else
  101. #define JUCE_MEDIUMP
  102. #define JUCE_HIGHP
  103. #define JUCE_LOWP
  104. #endif
  105. //=============================================================================
  106. namespace juce
  107. {
  108. class OpenGLTexture;
  109. class OpenGLFrameBuffer;
  110. class OpenGLShaderProgram;
  111. #include "geometry/juce_Quaternion.h"
  112. #include "geometry/juce_Matrix3D.h"
  113. #include "geometry/juce_Vector3D.h"
  114. #include "geometry/juce_Draggable3DOrientation.h"
  115. #include "native/juce_MissingGLDefinitions.h"
  116. #include "opengl/juce_OpenGLHelpers.h"
  117. #include "opengl/juce_OpenGLPixelFormat.h"
  118. #include "native/juce_OpenGLExtensions.h"
  119. #include "opengl/juce_OpenGLRenderer.h"
  120. #include "opengl/juce_OpenGLContext.h"
  121. #include "opengl/juce_OpenGLFrameBuffer.h"
  122. #include "opengl/juce_OpenGLGraphicsContext.h"
  123. #include "opengl/juce_OpenGLHelpers.h"
  124. #include "opengl/juce_OpenGLImage.h"
  125. #include "opengl/juce_OpenGLRenderer.h"
  126. #include "opengl/juce_OpenGLShaderProgram.h"
  127. #include "opengl/juce_OpenGLTexture.h"
  128. #include "utils/juce_OpenGLAppComponent.h"
  129. }
  130. #endif // JUCE_OPENGL_H_INCLUDED