| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsGLContext.h" |
| 6 | #include <GL/glxew.h> |
| 7 | |
| 8 | namespace bs { namespace ct |
| 9 | { |
| 10 | /** @addtogroup GL |
| 11 | * @{ |
| 12 | */ |
| 13 | |
| 14 | /** Linux specific implementation of an OpenGL context. */ |
| 15 | class LinuxContext : public GLContext |
| 16 | { |
| 17 | public: |
| 18 | /** |
| 19 | * Constructs a new OpenGL context. |
| 20 | * |
| 21 | * @param[in] x11display X11 display all windows using this context will be created with. |
| 22 | * @param[in] visualInfo X11 visual info describing properties of all windows that will use this context. |
| 23 | **/ |
| 24 | LinuxContext(::Display* x11display, XVisualInfo& visualInfo); |
| 25 | virtual ~LinuxContext(); |
| 26 | |
| 27 | /** @copydoc GLContext::setCurrent */ |
| 28 | void setCurrent(const RenderWindow& window) override; |
| 29 | |
| 30 | /** @copydoc GLContext::endCurrent */ |
| 31 | void endCurrent() override; |
| 32 | |
| 33 | /** @copydoc GLContext::releaseContext */ |
| 34 | void releaseContext() override; |
| 35 | |
| 36 | protected: |
| 37 | ::Display* mDisplay; |
| 38 | ::Window mCurrentWindow = 0; |
| 39 | GLXContext mContext = 0; |
| 40 | }; |
| 41 | |
| 42 | /** @} */ |
| 43 | }} |