BsWin32Context.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "Win32/BsWin32Prerequisites.h"
  5. #include "BsGLContext.h"
  6. namespace bs { namespace ct
  7. {
  8. /** @addtogroup GL
  9. * @{
  10. */
  11. /** Windows specific implementation of an OpenGL context. */
  12. class Win32Context : public GLContext
  13. {
  14. public:
  15. /**
  16. * Constructs a new context from a Windows device context and OpenGL rendering context. Optionally you may specify
  17. * that the context isn't owned by us (might be created by some external library), in which case it will not be
  18. * automatically released.
  19. */
  20. Win32Context(HDC hdc, HGLRC glrc, bool ownsContext);
  21. virtual ~Win32Context();
  22. /** @copydoc GLContext::setCurrent */
  23. void setCurrent() override;
  24. /** @copydoc GLContext::endCurrent */
  25. void endCurrent() override;
  26. /** @copydoc GLContext::releaseContext */
  27. void releaseContext() override;
  28. protected:
  29. HDC mHDC;
  30. HGLRC mGlrc;
  31. bool mOwnsContext;
  32. };
  33. /** @} */
  34. }}