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.

141 lines
4.7KB

  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. /** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux.
  78. @see OpenGLExtensionFunctions
  79. */
  80. #define JUCE_GL_VERTEXBUFFER_FUNCTIONS \
  81. X (glGenVertexArrays) \
  82. X (glDeleteVertexArrays) \
  83. X (glBindVertexArray)
  84. /** This class contains a generated list of OpenGL extension functions, which are either dynamically loaded
  85. for a specific GL context, or simply call-through to the appropriate OS function where available.
  86. This class is provided for backwards compatibility. In new code, you should prefer to use
  87. functions from the juce::gl namespace. By importing all these symbols with
  88. `using namespace ::juce::gl;`, all GL enumerations and functions will be made available at
  89. global scope. This may be helpful if you need to write code with C source compatibility, or
  90. which is compatible with a different extension-loading library.
  91. All the normal guidance about `using namespace` should still apply - don't do this in a header,
  92. or at all if you can possibly avoid it!
  93. @tags{OpenGL}
  94. */
  95. struct OpenGLExtensionFunctions
  96. {
  97. //==============================================================================
  98. #ifndef DOXYGEN
  99. [[deprecated ("A more complete set of GL commands can be found in the juce::gl namespace. "
  100. "You should use juce::gl::loadFunctions() to load GL functions.")]]
  101. static void initialise();
  102. #endif
  103. #if JUCE_WINDOWS && ! defined (DOXYGEN)
  104. typedef char GLchar;
  105. typedef pointer_sized_int GLsizeiptr;
  106. typedef pointer_sized_int GLintptr;
  107. #endif
  108. #define X(name) static decltype (::juce::gl::name)& name;
  109. JUCE_GL_BASE_FUNCTIONS
  110. JUCE_GL_EXTENSION_FUNCTIONS
  111. JUCE_GL_VERTEXBUFFER_FUNCTIONS
  112. #undef X
  113. };
  114. enum MissingOpenGLDefinitions
  115. {
  116. #if JUCE_ANDROID
  117. JUCE_RGBA_FORMAT = ::juce::gl::GL_RGBA,
  118. #else
  119. JUCE_RGBA_FORMAT = ::juce::gl::GL_BGRA_EXT,
  120. #endif
  121. };
  122. } // namespace juce