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.

68 lines
2.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. A set of miscellaneous openGL helper functions.
  18. @tags{OpenGL}
  19. */
  20. class JUCE_API OpenGLHelpers
  21. {
  22. public:
  23. /** Clears the GL error state. */
  24. static void resetErrorState();
  25. /** Returns true if the current thread has an active OpenGL context. */
  26. static bool isContextActive();
  27. /** Clears the current context using the given colour. */
  28. static void clear (Colour colour);
  29. static void enableScissorTest (Rectangle<int> clip);
  30. /** Checks whether the current context supports the specified extension. */
  31. static bool isExtensionSupported (const char* extensionName);
  32. /** Returns the address of a named GL extension function */
  33. static void* getExtensionFunction (const char* functionName);
  34. /** Makes some simple textual changes to a shader program to try to convert old GLSL
  35. keywords to their v3 equivalents.
  36. Before doing this, the function will check whether the current context is actually
  37. using a later version of the language, and if not it will not make any changes.
  38. Obviously this is not a real parser, so will only work on simple code!
  39. */
  40. static String translateVertexShaderToV3 (const String&);
  41. /** Makes some simple textual changes to a shader program to try to convert old GLSL
  42. keywords to their v3 equivalents.
  43. Before doing this, the function will check whether the current context is actually
  44. using a later version of the language, and if not it will not make any changes.
  45. Obviously this is not a real parser, so will only work on simple code!
  46. */
  47. static String translateFragmentShaderToV3 (const String&);
  48. };
  49. } // namespace juce