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.

169 lines
5.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifdef __JUCE_OPENGL_JUCEHEADER__
  19. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  20. already included any other headers - just put it inside a file on its own, possibly with your config
  21. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  22. header files that the compiler may be using.
  23. */
  24. #error "Incorrect use of JUCE cpp file"
  25. #endif
  26. // Your project must contain an AppConfig.h file with your project-specific settings in it,
  27. // and your header search path must make it accessible to the module's files.
  28. #include "AppConfig.h"
  29. #include "../juce_core/native/juce_BasicNativeHeaders.h"
  30. #include "juce_opengl.h"
  31. //==============================================================================
  32. #if JUCE_IOS
  33. #import <QuartzCore/QuartzCore.h>
  34. //==============================================================================
  35. #elif JUCE_WINDOWS
  36. #include <windowsx.h>
  37. #include <vfw.h>
  38. #include <commdlg.h>
  39. #if JUCE_WEB_BROWSER
  40. #include <Exdisp.h>
  41. #include <exdispid.h>
  42. #endif
  43. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  44. #pragma comment(lib, "vfw32.lib")
  45. #pragma comment(lib, "imm32.lib")
  46. #pragma comment(lib, "OpenGL32.Lib")
  47. #pragma comment(lib, "GlU32.Lib")
  48. #endif
  49. #if JUCE_QUICKTIME && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  50. #pragma comment (lib, "QTMLClient.lib")
  51. #endif
  52. #if JUCE_DIRECT2D && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  53. #pragma comment (lib, "Dwrite.lib")
  54. #pragma comment (lib, "D2d1.lib")
  55. #endif
  56. //==============================================================================
  57. #elif JUCE_LINUX
  58. #include <X11/Xlib.h>
  59. #include <X11/Xatom.h>
  60. #include <X11/Xresource.h>
  61. #include <X11/Xutil.h>
  62. #include <X11/Xmd.h>
  63. #include <X11/keysym.h>
  64. #include <X11/cursorfont.h>
  65. #if JUCE_USE_XINERAMA
  66. /* If you're trying to use Xinerama, you'll need to install the "libxinerama-dev" package.. */
  67. #include <X11/extensions/Xinerama.h>
  68. #endif
  69. #if JUCE_USE_XSHM
  70. #include <X11/extensions/XShm.h>
  71. #include <sys/shm.h>
  72. #include <sys/ipc.h>
  73. #endif
  74. #if JUCE_USE_XRENDER
  75. // If you're missing these headers, try installing the libxrender-dev and libxcomposite-dev
  76. #include <X11/extensions/Xrender.h>
  77. #include <X11/extensions/Xcomposite.h>
  78. #endif
  79. #if JUCE_USE_XCURSOR
  80. // If you're missing this header, try installing the libxcursor-dev package
  81. #include <X11/Xcursor/Xcursor.h>
  82. #endif
  83. /* Got an include error here?
  84. If you want to install OpenGL support, the packages to get are "mesa-common-dev"
  85. and "freeglut3-dev".
  86. */
  87. #include <GL/glx.h>
  88. #undef SIZEOF
  89. #undef KeyPress
  90. //==============================================================================
  91. #elif JUCE_ANDROID
  92. #include <GLES/glext.h>
  93. #endif
  94. #if JUCE_WINDOWS
  95. #define JUCE_DECLARE_GL_EXTENSION_FUNCTION(name, returnType, params) \
  96. typedef returnType (__stdcall *type_ ## name) params; static type_ ## name name;
  97. #else
  98. #define JUCE_DECLARE_GL_EXTENSION_FUNCTION(name, returnType, params) \
  99. typedef returnType (*type_ ## name) params; static type_ ## name name;
  100. #endif
  101. #define JUCE_INSTANTIATE_GL_EXTENSION(name) \
  102. name = (type_ ## name) OpenGLHelpers::getExtensionFunction (#name);
  103. //==============================================================================
  104. // START_AUTOINCLUDE opengl/*.cpp
  105. #include "opengl/juce_OpenGLComponent.cpp"
  106. #include "opengl/juce_OpenGLFrameBuffer.cpp"
  107. #include "opengl/juce_OpenGLGraphicsContext.cpp"
  108. #include "opengl/juce_OpenGLHelpers.cpp"
  109. #include "opengl/juce_OpenGLImage.cpp"
  110. #include "opengl/juce_OpenGLTexture.cpp"
  111. // END_AUTOINCLUDE
  112. using namespace juce;
  113. //==============================================================================
  114. BEGIN_JUCE_NAMESPACE
  115. #if JUCE_MAC || JUCE_IOS
  116. #include "../juce_core/native/juce_osx_ObjCHelpers.h"
  117. #include "../juce_core/native/juce_mac_ObjCSuffix.h"
  118. #include "../juce_graphics/native/juce_mac_CoreGraphicsHelpers.h"
  119. #if JUCE_MAC
  120. #include "native/juce_mac_OpenGLComponent.mm"
  121. #else
  122. #include "native/juce_ios_OpenGLComponent.mm"
  123. #endif
  124. #elif JUCE_WINDOWS
  125. #include "native/juce_win32_OpenGLComponent.cpp"
  126. #elif JUCE_LINUX
  127. #include "native/juce_linux_OpenGLComponent.cpp"
  128. #elif JUCE_ANDROID
  129. #include "native/juce_android_OpenGLComponent.cpp"
  130. #endif
  131. END_JUCE_NAMESPACE