BsWin32Context.h 1.3 KB

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