BsLinuxContext.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsGLContext.h"
  5. #include <GL/glxew.h>
  6. namespace bs { namespace ct
  7. {
  8. /** @addtogroup GL
  9. * @{
  10. */
  11. /** Linux specific implementation of an OpenGL context. */
  12. class LinuxContext : public GLContext
  13. {
  14. public:
  15. /**
  16. * Constructs a new OpenGL context.
  17. *
  18. * @param[in] x11display X11 display all windows using this context will be created with.
  19. * @param[in] visualInfo X11 visual info describing properties of all windows that will use this context.
  20. **/
  21. LinuxContext(::Display* x11display, XVisualInfo& visualInfo);
  22. virtual ~LinuxContext();
  23. /** @copydoc GLContext::setCurrent */
  24. void setCurrent(const RenderWindow& window) override;
  25. /** @copydoc GLContext::endCurrent */
  26. void endCurrent() override;
  27. /** @copydoc GLContext::releaseContext */
  28. void releaseContext() override;
  29. protected:
  30. ::Display* mDisplay;
  31. ::Window mCurrentWindow;
  32. GLXContext mContext;
  33. };
  34. /** @} */
  35. }}