]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CGLXManager.h
Reduce IrrCompileConfig usage to files that actually need it
[irrlicht.git] / source / Irrlicht / CGLXManager.h
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
4 \r
5 #ifndef __C_GLX_MANAGER_H_INCLUDED__\r
6 #define __C_GLX_MANAGER_H_INCLUDED__\r
7 \r
8 \r
9 #ifdef _IRR_COMPILE_WITH_GLX_MANAGER_\r
10 \r
11 #include "SIrrCreationParameters.h"\r
12 #include "SExposedVideoData.h"\r
13 #include "IContextManager.h"\r
14 #include "SColor.h"\r
15 #include <X11/Xlib.h>\r
16 #include <X11/Xutil.h>\r
17 \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
20 \r
21 namespace irr\r
22 {\r
23 namespace video\r
24 {\r
25     // GLX manager.\r
26     class CGLXManager : public IContextManager\r
27     {\r
28     public:\r
29         //! Constructor.\r
30         CGLXManager(const SIrrlichtCreationParameters& params, const SExposedVideoData& videodata, int screennr);\r
31 \r
32         //! Destructor\r
33         ~CGLXManager();\r
34 \r
35         // Initialize\r
36         bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;\r
37 \r
38         // Terminate\r
39         void terminate() override;\r
40 \r
41         // Create surface.\r
42         bool generateSurface() override;\r
43 \r
44         // Destroy surface.\r
45         void destroySurface() override;\r
46 \r
47         // Create context.\r
48         bool generateContext() override;\r
49 \r
50         // Destroy context.\r
51         void destroyContext() override;\r
52 \r
53         //! Get current context\r
54         const SExposedVideoData& getContext() const override;\r
55 \r
56         //! Change render context, disable old and activate new defined by videoData\r
57         bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;\r
58 \r
59                 // Get procedure address.\r
60                 void* getProcAddress(const std::string &procName) override;\r
61 \r
62         // Swap buffers.\r
63         bool swapBuffers() override;\r
64 \r
65         XVisualInfo* getVisual() const {return VisualInfo;} // return XVisualInfo\r
66 \r
67     private:\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
74         };\r
75 }\r
76 }\r
77 \r
78 #endif\r
79 \r
80 #endif\r
81 \r