]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CWGLManager.h
Reduce IrrCompileConfig usage to files that actually need it
[irrlicht.git] / source / Irrlicht / CWGLManager.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_WGL_MANAGER_H_INCLUDED__\r
6 #define __C_WGL_MANAGER_H_INCLUDED__\r
7 \r
8 \r
9 #ifdef _IRR_COMPILE_WITH_WGL_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 \r
16 #define WIN32_LEAN_AND_MEAN\r
17 #include <windows.h>\r
18 #include <libloaderapi.h>\r
19 \r
20 namespace irr\r
21 {\r
22 namespace video\r
23 {\r
24     // WGL manager.\r
25     class CWGLManager : public IContextManager\r
26     {\r
27     public:\r
28         //! Constructor.\r
29         CWGLManager();\r
30 \r
31                 //! Destructor\r
32                 ~CWGLManager();\r
33 \r
34         // Initialize\r
35         bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;\r
36 \r
37         // Terminate\r
38         void terminate() override;\r
39 \r
40         // Create surface.\r
41         bool generateSurface() override;\r
42 \r
43         // Destroy surface.\r
44         void destroySurface() override;\r
45 \r
46         // Create context.\r
47         bool generateContext() override;\r
48 \r
49         // Destroy EGL context.\r
50         void destroyContext() override;\r
51 \r
52                 //! Get current context\r
53                 const SExposedVideoData& getContext() const override;\r
54 \r
55                 //! Change render context, disable old and activate new defined by videoData\r
56                 bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;\r
57 \r
58                 // Get procedure address.\r
59                 void* getProcAddress(const std::string &procName) override;\r
60 \r
61         // Swap buffers.\r
62         bool swapBuffers() override;\r
63 \r
64     private:\r
65         SIrrlichtCreationParameters Params;\r
66                 SExposedVideoData PrimaryContext;\r
67         SExposedVideoData CurrentContext;\r
68                 s32 PixelFormat;\r
69                 PIXELFORMATDESCRIPTOR pfd;\r
70                 ECOLOR_FORMAT ColorFormat;\r
71         void* FunctionPointers[1];\r
72 \r
73                 HMODULE libHandle;\r
74         };\r
75 }\r
76 }\r
77 \r
78 #endif\r
79 \r
80 #endif\r