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.

113 lines
3.2KB

  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_CALLBACK_DEFINED
  22. #undef DGL_WINGDIAPI_DEFINED
  23. #ifdef DISTRHO_OS_WINDOWS
  24. #ifndef APIENTRY
  25. # define APIENTRY __stdcall
  26. #endif // APIENTRY
  27. /* We need WINGDIAPI defined */
  28. #ifndef WINGDIAPI
  29. # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
  30. # define WINGDIAPI __declspec(dllimport)
  31. # elif defined(__LCC__)
  32. # define WINGDIAPI __stdcall
  33. # else
  34. # define WINGDIAPI extern
  35. # endif
  36. # define DGL_WINGDIAPI_DEFINED
  37. #endif // WINGDIAPI
  38. /* Some <GL/glu.h> files also need CALLBACK defined */
  39. #ifndef CALLBACK
  40. # if defined(_MSC_VER)
  41. # if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
  42. # define CALLBACK __stdcall
  43. # else
  44. # define CALLBACK
  45. # endif
  46. # else
  47. # define CALLBACK __stdcall
  48. # endif
  49. # define DGL_CALLBACK_DEFINED
  50. #endif // CALLBACK
  51. #endif // DISTRHO_OS_WINDOWS
  52. // --------------------------------------------------------------------------------------------------------------------
  53. // OpenGL includes
  54. #ifdef DISTRHO_OS_MAC
  55. # ifdef DGL_USE_OPENGL3
  56. # include <OpenGL/gl3.h>
  57. # include <OpenGL/gl3ext.h>
  58. # else
  59. # include <OpenGL/gl.h>
  60. # endif
  61. #else
  62. # ifndef DISTRHO_OS_WINDOWS
  63. # define GL_GLEXT_PROTOTYPES
  64. # endif
  65. # ifndef __GLEW_H__
  66. # include <GL/gl.h>
  67. # include <GL/glext.h>
  68. # endif
  69. #endif
  70. // --------------------------------------------------------------------------------------------------------------------
  71. // Missing OpenGL defines
  72. #if defined(GL_BGR_EXT) && !defined(GL_BGR)
  73. # define GL_BGR GL_BGR_EXT
  74. #endif
  75. #if defined(GL_BGRA_EXT) && !defined(GL_BGRA)
  76. # define GL_BGRA GL_BGRA_EXT
  77. #endif
  78. #ifndef GL_CLAMP_TO_BORDER
  79. # define GL_CLAMP_TO_BORDER 0x812D
  80. #endif
  81. // --------------------------------------------------------------------------------------------------------------------
  82. // Fix OpenGL includes for Windows, based on glfw code (part 2)
  83. #ifdef DGL_CALLBACK_DEFINED
  84. # undef CALLBACK
  85. # undef DGL_CALLBACK_DEFINED
  86. #endif
  87. #ifdef DGL_WINGDIAPI_DEFINED
  88. # undef WINGDIAPI
  89. # undef DGL_WINGDIAPI_DEFINED
  90. #endif
  91. // --------------------------------------------------------------------------------------------------------------------
  92. #endif