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.

148 lines
4.7KB

  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_WINDOWS
  26. #ifndef APIENTRY
  27. #define APIENTRY __stdcall
  28. #define CLEAR_TEMP_APIENTRY 1
  29. #endif
  30. #ifndef WINGDIAPI
  31. #define WINGDIAPI __declspec(dllimport)
  32. #define CLEAR_TEMP_WINGDIAPI 1
  33. #endif
  34. #include <gl/GL.h>
  35. #ifdef CLEAR_TEMP_WINGDIAPI
  36. #undef WINGDIAPI
  37. #undef CLEAR_TEMP_WINGDIAPI
  38. #endif
  39. #ifdef CLEAR_TEMP_APIENTRY
  40. #undef APIENTRY
  41. #undef CLEAR_TEMP_APIENTRY
  42. #endif
  43. #elif JUCE_LINUX
  44. #include <GL/gl.h>
  45. #undef KeyPress
  46. #elif JUCE_IOS
  47. #if defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
  48. #include <OpenGLES/ES3/gl.h>
  49. #else
  50. #include <OpenGLES/ES2/gl.h>
  51. #endif
  52. #elif JUCE_MAC
  53. #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
  54. #include <OpenGL/gl3.h>
  55. #include <OpenGL/gl3ext.h>
  56. #else
  57. #include <OpenGL/gl.h>
  58. #include "OpenGL/glext.h"
  59. #endif
  60. #elif JUCE_ANDROID
  61. #include <GLES2/gl2.h>
  62. #endif
  63. #if GL_VERSION_3_2 || GL_ES_VERSION_3_0
  64. #define JUCE_OPENGL3 1
  65. #endif
  66. //=============================================================================
  67. /** This macro is a helper for use in GLSL shader code which needs to compile on both OpenGL 2.1 and OpenGL 3.0.
  68. It's mandatory in OpenGL 3.0 to specify the GLSL version.
  69. */
  70. #if JUCE_OPENGL3
  71. #if JUCE_OPENGL_ES
  72. #define JUCE_GLSL_VERSION "#version 300 es"
  73. #else
  74. #define JUCE_GLSL_VERSION "#version 150"
  75. #endif
  76. #else
  77. #define JUCE_GLSL_VERSION ""
  78. #endif
  79. //=============================================================================
  80. #if JUCE_OPENGL_ES || defined (DOXYGEN)
  81. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  82. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  83. these macros define the various precision keywords only on GLES.
  84. */
  85. #define JUCE_MEDIUMP "mediump"
  86. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  87. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  88. these macros define the various precision keywords only on GLES.
  89. */
  90. #define JUCE_HIGHP "highp"
  91. /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
  92. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
  93. these macros define the various precision keywords only on GLES.
  94. */
  95. #define JUCE_LOWP "lowp"
  96. #else
  97. #define JUCE_MEDIUMP
  98. #define JUCE_HIGHP
  99. #define JUCE_LOWP
  100. #endif
  101. //=============================================================================
  102. namespace juce
  103. {
  104. class OpenGLTexture;
  105. class OpenGLFrameBuffer;
  106. class OpenGLShaderProgram;
  107. #include "native/juce_MissingGLDefinitions.h"
  108. #include "opengl/juce_OpenGLHelpers.h"
  109. #include "opengl/juce_Quaternion.h"
  110. #include "opengl/juce_Matrix3D.h"
  111. #include "opengl/juce_Draggable3DOrientation.h"
  112. #include "opengl/juce_OpenGLPixelFormat.h"
  113. #include "native/juce_OpenGLExtensions.h"
  114. #include "opengl/juce_OpenGLRenderer.h"
  115. #include "opengl/juce_OpenGLContext.h"
  116. #include "opengl/juce_OpenGLFrameBuffer.h"
  117. #include "opengl/juce_OpenGLGraphicsContext.h"
  118. #include "opengl/juce_OpenGLHelpers.h"
  119. #include "opengl/juce_OpenGLImage.h"
  120. #include "opengl/juce_OpenGLRenderer.h"
  121. #include "opengl/juce_OpenGLShaderProgram.h"
  122. #include "opengl/juce_OpenGLTexture.h"
  123. #include "opengl/juce_Vector3D.h"
  124. }
  125. #endif // JUCE_OPENGL_H_INCLUDED