BsWin32Context.h 1.3 KB

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