mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 01:09:50 +00:00
Fixed: Call Cocoa API when required to not conflict with Qt
This commit is contained in:
parent
a87c252e3a
commit
84934d3bee
2 changed files with 16 additions and 24 deletions
|
@ -196,18 +196,6 @@ CDriverGL::CDriverGL()
|
|||
_backBufferHeight = 0;
|
||||
_backBufferWidth = 0;
|
||||
|
||||
// autorelease pool for memory management
|
||||
_autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// init the application object
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
// create the menu in the top screen bar
|
||||
setupApplicationMenu();
|
||||
|
||||
// finish the application launching
|
||||
[NSApp finishLaunching];
|
||||
|
||||
#elif defined (NL_OS_UNIX)
|
||||
|
||||
_dpy = 0;
|
||||
|
@ -373,10 +361,6 @@ CDriverGL::~CDriverGL()
|
|||
{
|
||||
H_AUTO_OGL(CDriverGL_CDriverGLDtor)
|
||||
release();
|
||||
|
||||
#if defined(NL_OS_MAC)
|
||||
[_autoreleasePool release];
|
||||
#endif
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
|
@ -942,13 +926,6 @@ bool CDriverGL::swapBuffers()
|
|||
|
||||
#elif defined(NL_OS_MAC)
|
||||
|
||||
// TODO: maybe do this somewhere else?
|
||||
if(_DestroyWindow)
|
||||
{
|
||||
[_autoreleasePool release];
|
||||
_autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
[_ctx flushBuffer];
|
||||
|
||||
#elif defined (NL_OS_UNIX)
|
||||
|
|
|
@ -343,9 +343,14 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc)
|
|||
retrieveATIDriverVersion();
|
||||
#elif defined(NL_OS_MAC)
|
||||
|
||||
// nothing to do
|
||||
nlunreferenced(windowIcon);
|
||||
|
||||
// autorelease pool for memory management
|
||||
_autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// init the application object
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
#elif defined (NL_OS_UNIX)
|
||||
|
||||
nlunreferenced(windowIcon);
|
||||
|
@ -486,6 +491,7 @@ bool CDriverGL::unInit()
|
|||
#elif defined(NL_OS_MAC)
|
||||
|
||||
// nothing to do
|
||||
[_autoreleasePool release];
|
||||
|
||||
#elif defined (NL_OS_UNIX)
|
||||
|
||||
|
@ -1466,6 +1472,12 @@ bool CDriverGL::createWindow(const GfxMode &mode)
|
|||
|
||||
#elif defined(NL_OS_MAC)
|
||||
|
||||
// create the menu in the top screen bar
|
||||
setupApplicationMenu();
|
||||
|
||||
// finish the application launching
|
||||
[NSApp finishLaunching];
|
||||
|
||||
// describe how the window should look like and behave
|
||||
unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask | NSResizableWindowMask;
|
||||
|
@ -1642,6 +1654,7 @@ bool CDriverGL::destroyWindow()
|
|||
}
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
|
||||
#elif defined(NL_OS_UNIX)
|
||||
|
||||
if (_DestroyWindow && _ctx) // FIXME: _DestroyWindow may need to be removed here as well
|
||||
|
@ -1664,6 +1677,8 @@ bool CDriverGL::destroyWindow()
|
|||
[[containerView() window] release];
|
||||
[containerView() release];
|
||||
[_glView release];
|
||||
|
||||
[_autoreleasePool release];
|
||||
}
|
||||
|
||||
_ctx = nil;
|
||||
|
|
Loading…
Reference in a new issue