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
5 #ifndef __C_NSOGL_MANAGER_H_INCLUDED__
\r
6 #define __C_NSOGL_MANAGER_H_INCLUDED__
\r
8 #include "IrrCompileConfig.h"
\r
10 #ifdef _IRR_COMPILE_WITH_NSOGL_MANAGER_
\r
12 #include "SIrrCreationParameters.h"
\r
13 #include "SExposedVideoData.h"
\r
14 #include "IContextManager.h"
\r
17 #import <AppKit/NSOpenGL.h>
\r
23 // NSOpenGL manager.
\r
24 class CNSOGLManager : public IContextManager
\r
34 bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
\r
37 void terminate() override;
\r
40 bool generateSurface() override;
\r
43 void destroySurface() override;
\r
46 bool generateContext() override;
\r
48 // Destroy EGL context.
\r
49 void destroyContext() override;
\r
51 //! Get current context
\r
52 const SExposedVideoData& getContext() const;
\r
54 //! Change render context, disable old and activate new defined by videoData
\r
55 bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;
\r
57 // Get procedure address.
\r
58 void* getProcAddress(const std::string &procName) override;
\r
61 bool swapBuffers() override;
\r
64 SIrrlichtCreationParameters Params;
\r
65 SExposedVideoData PrimaryContext;
\r
66 SExposedVideoData CurrentContext;
\r
68 NSOpenGLPixelFormat* PixelFormat;
\r