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.

67 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_OPENGLHELPERS_JUCEHEADER__
  19. #define __JUCE_OPENGLHELPERS_JUCEHEADER__
  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. /** Clears the current context using the given colour. */
  29. static void clear (const Colour& colour);
  30. /** Sets the current colour using a JUCE colour. */
  31. static void setColour (const Colour& colour);
  32. /** Gives the current context an orthoganal rendering mode for 2D drawing into the given size. */
  33. static void prepareFor2D (int width, int height);
  34. /** This does the same job as gluPerspective(). */
  35. static void setPerspective (double fovy, double aspect, double zNear, double zFar);
  36. /** Draws a 2D quad with the specified corner points. */
  37. static void drawQuad2D (float x1, float y1,
  38. float x2, float y2,
  39. float x3, float y3,
  40. float x4, float y4,
  41. const Colour& colour);
  42. /** Draws a 3D quad with the specified corner points. */
  43. static void drawQuad3D (float x1, float y1, float z1,
  44. float x2, float y2, float z2,
  45. float x3, float y3, float z3,
  46. float x4, float y4, float z4,
  47. const Colour& colour);
  48. };
  49. #endif // __JUCE_OPENGLHELPERS_JUCEHEADER__