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.

74 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_OPENGLHELPERS_H_INCLUDED
  18. #define JUCE_OPENGLHELPERS_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. A set of miscellaneous openGL helper functions.
  22. */
  23. class JUCE_API OpenGLHelpers
  24. {
  25. public:
  26. /** Clears the GL error state. */
  27. static void resetErrorState();
  28. /** Returns true if the current thread has an active OpenGL context. */
  29. static bool isContextActive();
  30. /** Clears the current context using the given colour. */
  31. static void clear (Colour colour);
  32. static void enableScissorTest (const Rectangle<int>& clip);
  33. /** Checks whether the current context supports the specified extension. */
  34. static bool isExtensionSupported (const char* extensionName);
  35. /** Returns the address of a named GL extension function */
  36. static void* getExtensionFunction (const char* functionName);
  37. /** Makes some simple textual changes to a shader program to try to convert old GLSL
  38. keywords to their v3 equivalents.
  39. Before doing this, the function will check whether the current context is actually
  40. using a later version of the language, and if not it will not make any changes.
  41. Obviously this is not a real parser, so will only work on simple code!
  42. */
  43. static String translateVertexShaderToV3 (const String&);
  44. /** Makes some simple textual changes to a shader program to try to convert old GLSL
  45. keywords to their v3 equivalents.
  46. Before doing this, the function will check whether the current context is actually
  47. using a later version of the language, and if not it will not make any changes.
  48. Obviously this is not a real parser, so will only work on simple code!
  49. */
  50. static String translateFragmentShaderToV3 (const String&);
  51. };
  52. #endif // JUCE_OPENGLHELPERS_H_INCLUDED