BsGLContext.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsGLPrerequisites.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Abstract class that encapsulated an OpenGL context. Each platform
  9. * should provide its own GLContext specialization.
  10. */
  11. class BS_RSGL_EXPORT GLContext
  12. {
  13. public:
  14. GLContext();
  15. virtual ~GLContext();
  16. /**
  17. * @brief Activates the rendering context (all subsequent rendering commands will be executed on it).
  18. */
  19. virtual void setCurrent() = 0;
  20. /**
  21. * @brief Deactivates the rendering context. Normally called just before setCurrent is called on another context.
  22. */
  23. virtual void endCurrent() = 0;
  24. /**
  25. * @brief Releases the render context, freeing all of its resources.
  26. */
  27. virtual void releaseContext() {}
  28. };
  29. }