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
9 #ifdef _IRR_COMPILE_WITH_NSOGL_MANAGER_
\r
11 #include "SIrrCreationParameters.h"
\r
12 #include "SExposedVideoData.h"
\r
13 #include "IContextManager.h"
\r
16 #import <AppKit/NSOpenGL.h>
\r
22 // NSOpenGL manager.
\r
23 class CNSOGLManager : public IContextManager
\r
33 bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
\r
36 void terminate() override;
\r
39 bool generateSurface() override;
\r
42 void destroySurface() override;
\r
45 bool generateContext() override;
\r
47 // Destroy EGL context.
\r
48 void destroyContext() override;
\r
50 //! Get current context
\r
51 const SExposedVideoData& getContext() const;
\r
53 //! Change render context, disable old and activate new defined by videoData
\r
54 bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;
\r
56 // Get procedure address.
\r
57 void* getProcAddress(const std::string &procName) override;
\r
60 bool swapBuffers() override;
\r
63 SIrrlichtCreationParameters Params;
\r
64 SExposedVideoData PrimaryContext;
\r
65 SExposedVideoData CurrentContext;
\r
67 NSOpenGLPixelFormat* PixelFormat;
\r