BsGLContext.h 779 B

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