2
0

BsWin32Context.h 1017 B

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