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.

87 lines
3.3KB

  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_OPENGLGRAPHICSCONTEXT_JUCEHEADER__
  19. #define __JUCE_OPENGLGRAPHICSCONTEXT_JUCEHEADER__
  20. //==============================================================================
  21. /** A LowLevelGraphicsContext for rendering into an OpenGL framebuffer or window.
  22. */
  23. class JUCE_API OpenGLRenderer : public LowLevelGraphicsContext
  24. {
  25. public:
  26. explicit OpenGLRenderer (OpenGLComponent& target);
  27. explicit OpenGLRenderer (OpenGLFrameBuffer& target);
  28. OpenGLRenderer (unsigned int frameBufferID, int width, int height);
  29. ~OpenGLRenderer();
  30. bool isVectorDevice() const;
  31. void setOrigin (int x, int y);
  32. void addTransform (const AffineTransform&);
  33. float getScaleFactor();
  34. bool clipToRectangle (const Rectangle<int>&);
  35. bool clipToRectangleList (const RectangleList&);
  36. void excludeClipRectangle (const Rectangle<int>&);
  37. void clipToPath (const Path& path, const AffineTransform&);
  38. void clipToImageAlpha (const Image& sourceImage, const AffineTransform&);
  39. bool clipRegionIntersects (const Rectangle<int>&);
  40. Rectangle<int> getClipBounds() const;
  41. bool isClipEmpty() const;
  42. void saveState();
  43. void restoreState();
  44. void beginTransparencyLayer (float opacity);
  45. void endTransparencyLayer();
  46. void setFill (const FillType& fillType);
  47. void setOpacity (float newOpacity);
  48. void setInterpolationQuality (Graphics::ResamplingQuality);
  49. void fillRect (const Rectangle<int>& r, bool replaceExistingContents);
  50. void fillPath (const Path& path, const AffineTransform& transform);
  51. void drawImage (const Image& sourceImage, const AffineTransform& transform);
  52. void drawLine (const Line <float>& line);
  53. void drawVerticalLine (int x, float top, float bottom);
  54. void drawHorizontalLine (int y, float left, float right);
  55. void setFont (const Font&);
  56. Font getFont();
  57. void drawGlyph (int glyphNumber, const AffineTransform&);
  58. #ifndef DOXYGEN
  59. class SavedState;
  60. class GLState;
  61. #endif
  62. private:
  63. ScopedPointer<GLState> glState;
  64. RenderingHelpers::SavedStateStack<SavedState> stack;
  65. };
  66. #endif // __JUCE_OPENGLGRAPHICSCONTEXT_JUCEHEADER__