]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CWGLManager.h
bd750650cf2e337741120c6738adea828bbf5e5f
[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 #include "IrrCompileConfig.h"\r
9 \r
10 #ifdef _IRR_COMPILE_WITH_WGL_MANAGER_\r
11 \r
12 #include "SIrrCreationParameters.h"\r
13 #include "SExposedVideoData.h"\r
14 #include "IContextManager.h"\r
15 #include "SColor.h"\r
16 \r
17 #define WIN32_LEAN_AND_MEAN\r
18 #include <windows.h>\r
19 #include <libloaderapi.h>\r
20 \r
21 namespace irr\r
22 {\r
23 namespace video\r
24 {\r
25     // WGL manager.\r
26     class CWGLManager : public IContextManager\r
27     {\r
28     public:\r
29         //! Constructor.\r
30         CWGLManager();\r
31 \r
32                 //! Destructor\r
33                 ~CWGLManager();\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 EGL 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     private:\r
66         SIrrlichtCreationParameters Params;\r
67                 SExposedVideoData PrimaryContext;\r
68         SExposedVideoData CurrentContext;\r
69                 s32 PixelFormat;\r
70                 PIXELFORMATDESCRIPTOR pfd;\r
71                 ECOLOR_FORMAT ColorFormat;\r
72         void* FunctionPointers[1];\r
73 \r
74                 HMODULE libHandle;\r
75         };\r
76 }\r
77 }\r
78 \r
79 #endif\r
80 \r
81 #endif\r