Audio plugin host https://kx.studio/carla
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.

103 lines
2.9KB

  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef DGL_OPENGL_INCLUDE_HPP_INCLUDED
  17. #define DGL_OPENGL_INCLUDE_HPP_INCLUDED
  18. #include "../distrho/src/DistrhoDefines.h"
  19. // --------------------------------------------------------------------------------------------------------------------
  20. // Fix OpenGL includes for Windows, based on glfw code (part 1)
  21. #undef DGL_WINGDIAPI_DEFINED
  22. #ifdef DISTRHO_OS_WINDOWS
  23. #ifndef WINAPI
  24. # define WINAPI __stdcall
  25. #endif
  26. #ifndef APIENTRY
  27. # define APIENTRY WINAPI
  28. #endif // APIENTRY
  29. /* We need WINGDIAPI defined */
  30. #ifndef WINGDIAPI
  31. # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
  32. # define WINGDIAPI __declspec(dllimport)
  33. # elif defined(__LCC__)
  34. # define WINGDIAPI __stdcall
  35. # else
  36. # define WINGDIAPI extern
  37. # endif
  38. # define DGL_WINGDIAPI_DEFINED
  39. #endif // WINGDIAPI
  40. #endif // DISTRHO_OS_WINDOWS
  41. // --------------------------------------------------------------------------------------------------------------------
  42. // OpenGL includes
  43. #ifdef DISTRHO_OS_MAC
  44. # ifdef DGL_USE_OPENGL3
  45. // NOTE GLES with macOS is not supported
  46. # ifdef DGL_USE_GLES
  47. # undef DGL_USE_GLES
  48. # undef DGL_USE_GLES2
  49. # undef DGL_USE_GLES3
  50. # endif
  51. # include <OpenGL/gl3.h>
  52. # include <OpenGL/gl3ext.h>
  53. # else
  54. # include <OpenGL/gl.h>
  55. # endif
  56. #else
  57. # ifndef DISTRHO_OS_WINDOWS
  58. # define GL_GLEXT_PROTOTYPES
  59. # endif
  60. # ifndef __GLEW_H__
  61. # include <GL/gl.h>
  62. # include <GL/glext.h>
  63. # endif
  64. #endif
  65. // --------------------------------------------------------------------------------------------------------------------
  66. // Missing OpenGL defines
  67. #if defined(GL_BGR_EXT) && !defined(GL_BGR)
  68. # define GL_BGR GL_BGR_EXT
  69. #endif
  70. #if defined(GL_BGRA_EXT) && !defined(GL_BGRA)
  71. # define GL_BGRA GL_BGRA_EXT
  72. #endif
  73. #ifndef GL_CLAMP_TO_BORDER
  74. # define GL_CLAMP_TO_BORDER 0x812D
  75. #endif
  76. // --------------------------------------------------------------------------------------------------------------------
  77. // Fix OpenGL includes for Windows, based on glfw code (part 2)
  78. #ifdef DGL_WINGDIAPI_DEFINED
  79. # undef WINGDIAPI
  80. # undef DGL_WINGDIAPI_DEFINED
  81. #endif
  82. // --------------------------------------------------------------------------------------------------------------------
  83. #endif