1 // Copyright (C) 2013 Christian Stehno
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in Irrlicht.h
\r
5 #ifndef __C_GLX_MANAGER_H_INCLUDED__
\r
6 #define __C_GLX_MANAGER_H_INCLUDED__
\r
9 #ifdef _IRR_COMPILE_WITH_GLX_MANAGER_
\r
11 #include "SIrrCreationParameters.h"
\r
12 #include "SExposedVideoData.h"
\r
13 #include "IContextManager.h"
\r
15 #include <X11/Xlib.h>
\r
16 #include <X11/Xutil.h>
\r
18 // we can't include glx.h here, because gl.h has incompatible types with ogl es headers and it
\r
19 // cause redefinition errors, thats why we use ugly trick with void* types and casts.
\r
26 class CGLXManager : public IContextManager
\r
30 CGLXManager(const SIrrlichtCreationParameters& params, const SExposedVideoData& videodata, int screennr);
\r
36 bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
\r
39 void terminate() override;
\r
42 bool generateSurface() override;
\r
45 void destroySurface() override;
\r
48 bool generateContext() override;
\r
51 void destroyContext() override;
\r
53 //! Get current context
\r
54 const SExposedVideoData& getContext() const override;
\r
56 //! Change render context, disable old and activate new defined by videoData
\r
57 bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;
\r
59 // Get procedure address.
\r
60 void* getProcAddress(const std::string &procName) override;
\r
63 bool swapBuffers() override;
\r
65 XVisualInfo* getVisual() const {return VisualInfo;} // return XVisualInfo
\r
68 SIrrlichtCreationParameters Params;
\r
69 SExposedVideoData PrimaryContext;
\r
70 SExposedVideoData CurrentContext;
\r
71 XVisualInfo* VisualInfo;
\r
72 void* glxFBConfig; // GLXFBConfig
\r
73 XID GlxWin; // GLXWindow
\r