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.9KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 6 End-User License
  8. Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
  9. End User License Agreement: www.juce.com/juce-6-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. namespace juce
  19. {
  20. /** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux.
  21. @see OpenGLExtensionFunctions
  22. */
  23. #define JUCE_GL_BASE_FUNCTIONS \
  24. X (glActiveTexture) \
  25. X (glBindBuffer) \
  26. X (glDeleteBuffers) \
  27. X (glGenBuffers) \
  28. X (glBufferData) \
  29. X (glBufferSubData) \
  30. X (glCreateProgram) \
  31. X (glDeleteProgram) \
  32. X (glCreateShader) \
  33. X (glDeleteShader) \
  34. X (glShaderSource) \
  35. X (glCompileShader) \
  36. X (glAttachShader) \
  37. X (glLinkProgram) \
  38. X (glUseProgram) \
  39. X (glGetShaderiv) \
  40. X (glGetShaderInfoLog) \
  41. X (glGetProgramInfoLog) \
  42. X (glGetProgramiv) \
  43. X (glGetUniformLocation) \
  44. X (glGetAttribLocation) \
  45. X (glVertexAttribPointer) \
  46. X (glEnableVertexAttribArray) \
  47. X (glDisableVertexAttribArray) \
  48. X (glUniform1f) \
  49. X (glUniform1i) \
  50. X (glUniform2f) \
  51. X (glUniform3f) \
  52. X (glUniform4f) \
  53. X (glUniform4i) \
  54. X (glUniform1fv) \
  55. X (glUniformMatrix2fv) \
  56. X (glUniformMatrix3fv) \
  57. X (glUniformMatrix4fv) \
  58. X (glBindAttribLocation)
  59. /** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux.
  60. @see OpenGLExtensionFunctions
  61. */
  62. #define JUCE_GL_EXTENSION_FUNCTIONS \
  63. X (glIsRenderbuffer) \
  64. X (glBindRenderbuffer) \
  65. X (glDeleteRenderbuffers) \
  66. X (glGenRenderbuffers) \
  67. X (glRenderbufferStorage) \
  68. X (glGetRenderbufferParameteriv) \
  69. X (glIsFramebuffer) \
  70. X (glBindFramebuffer) \
  71. X (glDeleteFramebuffers) \
  72. X (glGenFramebuffers) \
  73. X (glCheckFramebufferStatus) \
  74. X (glFramebufferTexture2D) \
  75. X (glFramebufferRenderbuffer) \
  76. X (glGetFramebufferAttachmentParameteriv) \
  77. X (glTransformFeedbackVaryings) \
  78. X (glBeginTransformFeedback) \
  79. X (glEndTransformFeedback) \
  80. X (glBindBufferBase) \
  81. X (glMapBufferRange) \
  82. X (glUnmapBuffer)
  83. /** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux.
  84. @see OpenGLExtensionFunctions
  85. */
  86. #define JUCE_GL_VERTEXBUFFER_FUNCTIONS \
  87. X (glGenVertexArrays) \
  88. X (glDeleteVertexArrays) \
  89. X (glBindVertexArray)
  90. /** This class contains a generated list of OpenGL extension functions, which are either dynamically loaded
  91. for a specific GL context, or simply call-through to the appropriate OS function where available.
  92. This class is provided for backwards compatibility. In new code, you should prefer to use
  93. functions from the juce::gl namespace. By importing all these symbols with
  94. `using namespace ::juce::gl;`, all GL enumerations and functions will be made available at
  95. global scope. This may be helpful if you need to write code with C source compatibility, or
  96. which is compatible with a different extension-loading library.
  97. All the normal guidance about `using namespace` should still apply - don't do this in a header,
  98. or at all if you can possibly avoid it!
  99. @tags{OpenGL}
  100. */
  101. struct OpenGLExtensionFunctions
  102. {
  103. //==============================================================================
  104. #ifndef DOXYGEN
  105. [[deprecated ("A more complete set of GL commands can be found in the juce::gl namespace. "
  106. "You should use juce::gl::loadFunctions() to load GL functions.")]]
  107. static void initialise();
  108. #endif
  109. #if JUCE_WINDOWS && ! defined (DOXYGEN)
  110. typedef char GLchar;
  111. typedef pointer_sized_int GLsizeiptr;
  112. typedef pointer_sized_int GLintptr;
  113. #endif
  114. #define X(name) static decltype (::juce::gl::name)& name;
  115. JUCE_GL_BASE_FUNCTIONS
  116. JUCE_GL_EXTENSION_FUNCTIONS
  117. JUCE_GL_VERTEXBUFFER_FUNCTIONS
  118. #undef X
  119. };
  120. enum MissingOpenGLDefinitions
  121. {
  122. #if JUCE_ANDROID
  123. JUCE_RGBA_FORMAT = ::juce::gl::GL_RGBA,
  124. #else
  125. JUCE_RGBA_FORMAT = ::juce::gl::GL_BGRA_EXT,
  126. #endif
  127. };
  128. } // namespace juce