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.

70 lines
2.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software 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_OPENGLRENDERER_H_INCLUDED
  18. #define JUCE_OPENGLRENDERER_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. A base class that should be implemented by classes which want to render openGL
  22. on a background thread.
  23. @see OpenGLContext
  24. */
  25. class JUCE_API OpenGLRenderer
  26. {
  27. public:
  28. OpenGLRenderer() {}
  29. virtual ~OpenGLRenderer() {}
  30. /** Called when a new GL context has been created.
  31. You can use this as an opportunity to create your textures, shaders, etc.
  32. When the method is invoked, the new GL context will be active.
  33. Note that this callback will be made on a background thread, so make sure
  34. that your implementation is thread-safe.
  35. */
  36. virtual void newOpenGLContextCreated() = 0;
  37. /** Called when you should render the next openGL frame.
  38. Note that this callback will be made on a background thread, so make sure
  39. that your implementation is thread-safe.
  40. */
  41. virtual void renderOpenGL() = 0;
  42. /** Called when the current openGL context is about to close.
  43. You can use this opportunity to release any GL resources that you may have
  44. created.
  45. Note that this callback will be made on a background thread, so make sure
  46. that your implementation is thread-safe.
  47. (Also note that on Android, this callback won't happen, because there's currently
  48. no way to implement it..)
  49. */
  50. virtual void openGLContextClosing() = 0;
  51. };
  52. #endif // JUCE_OPENGLRENDERER_H_INCLUDED