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