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.

157 lines
4.9KB

  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. #define JUCE_DONT_DEFINE_MACROS 1
  30. #include "../juce_core/native/juce_BasicNativeHeaders.h"
  31. #include "juce_opengl.h"
  32. //==============================================================================
  33. #if JUCE_IOS
  34. #import <QuartzCore/QuartzCore.h>
  35. #include <OpenGLES/ES1/gl.h>
  36. #include <OpenGLES/ES1/glext.h>
  37. //==============================================================================
  38. #elif JUCE_WINDOWS
  39. #include <windowsx.h>
  40. #include <vfw.h>
  41. #include <commdlg.h>
  42. #if JUCE_WEB_BROWSER
  43. #include <Exdisp.h>
  44. #include <exdispid.h>
  45. #endif
  46. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  47. #pragma comment(lib, "vfw32.lib")
  48. #pragma comment(lib, "imm32.lib")
  49. #endif
  50. #include <gl/gl.h>
  51. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  52. #pragma comment(lib, "OpenGL32.Lib")
  53. #pragma comment(lib, "GlU32.Lib")
  54. #endif
  55. #if JUCE_QUICKTIME && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  56. #pragma comment (lib, "QTMLClient.lib")
  57. #endif
  58. #if JUCE_DIRECT2D && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  59. #pragma comment (lib, "Dwrite.lib")
  60. #pragma comment (lib, "D2d1.lib")
  61. #endif
  62. //==============================================================================
  63. #elif JUCE_LINUX
  64. #include <X11/Xlib.h>
  65. #include <X11/Xatom.h>
  66. #include <X11/Xresource.h>
  67. #include <X11/Xutil.h>
  68. #include <X11/Xmd.h>
  69. #include <X11/keysym.h>
  70. #include <X11/cursorfont.h>
  71. #if JUCE_USE_XINERAMA
  72. /* If you're trying to use Xinerama, you'll need to install the "libxinerama-dev" package.. */
  73. #include <X11/extensions/Xinerama.h>
  74. #endif
  75. #if JUCE_USE_XSHM
  76. #include <X11/extensions/XShm.h>
  77. #include <sys/shm.h>
  78. #include <sys/ipc.h>
  79. #endif
  80. #if JUCE_USE_XRENDER
  81. // If you're missing these headers, try installing the libxrender-dev and libxcomposite-dev
  82. #include <X11/extensions/Xrender.h>
  83. #include <X11/extensions/Xcomposite.h>
  84. #endif
  85. #if JUCE_USE_XCURSOR
  86. // If you're missing this header, try installing the libxcursor-dev package
  87. #include <X11/Xcursor/Xcursor.h>
  88. #endif
  89. /* Got an include error here?
  90. If you want to install OpenGL support, the packages to get are "mesa-common-dev"
  91. and "freeglut3-dev".
  92. */
  93. #include <GL/glx.h>
  94. #undef SIZEOF
  95. #undef KeyPress
  96. #endif
  97. //==============================================================================
  98. // START_AUTOINCLUDE opengl/*.cpp
  99. #include "opengl/juce_OpenGLComponent.cpp"
  100. // END_AUTOINCLUDE
  101. using namespace juce;
  102. //==============================================================================
  103. BEGIN_JUCE_NAMESPACE
  104. #if JUCE_MAC || JUCE_IOS
  105. #include "../juce_core/native/juce_osx_ObjCHelpers.h"
  106. #include "../juce_core/native/juce_mac_ObjCSuffix.h"
  107. #include "../juce_graphics/native/juce_mac_CoreGraphicsHelpers.h"
  108. #if JUCE_MAC
  109. #include "native/juce_mac_OpenGLComponent.mm"
  110. #else
  111. #include "native/juce_ios_OpenGLComponent.mm"
  112. #endif
  113. #elif JUCE_WINDOWS
  114. #include "native/juce_win32_OpenGLComponent.cpp"
  115. #elif JUCE_LINUX
  116. #include "native/juce_linux_OpenGLComponent.cpp"
  117. #elif JUCE_ANDROID
  118. #include "native/juce_android_OpenGLComponent.cpp"
  119. #endif
  120. END_JUCE_NAMESPACE