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