mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 06:44:27 +08:00
Fixed macOS build
This commit is contained in:
@@ -933,13 +933,13 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
|
|||||||
- (void)windowDidChangeScreen:(NSNotification *)aNotification
|
- (void)windowDidChangeScreen:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
/*printf("WINDOWDIDCHANGESCREEN\n");*/
|
/*printf("WINDOWDIDCHANGESCREEN\n");*/
|
||||||
#ifdef SDL_VIDEO_OPENGL
|
#ifdef SDL_VIDEO_OPENGL
|
||||||
if (_data && _data.nscontexts) {
|
if (_data && _data.nscontexts) {
|
||||||
for (SDLOpenGLContext *context in _data.nscontexts) {
|
for (SDLOpenGLContext *context in _data.nscontexts) {
|
||||||
[context movedToNewScreen];
|
[context movedToNewScreen];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* SDL_VIDEO_OPENGL */
|
#endif /* SDL_VIDEO_OPENGL */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowWillEnterFullScreen:(NSNotification *)aNotification
|
- (void)windowWillEnterFullScreen:(NSNotification *)aNotification
|
||||||
@@ -2348,6 +2348,10 @@ void Cocoa_DestroyWindow(_THIS, SDL_Window * window)
|
|||||||
SDL_WindowData *data = (SDL_WindowData *) CFBridgingRelease(window->driverdata);
|
SDL_WindowData *data = (SDL_WindowData *) CFBridgingRelease(window->driverdata);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
#ifdef SDL_VIDEO_OPENGL
|
||||||
|
NSArray *contexts;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ([data.listener isInFullscreenSpace]) {
|
if ([data.listener isInFullscreenSpace]) {
|
||||||
[NSMenu setMenuBarVisible:YES];
|
[NSMenu setMenuBarVisible:YES];
|
||||||
}
|
}
|
||||||
@@ -2359,15 +2363,13 @@ void Cocoa_DestroyWindow(_THIS, SDL_Window * window)
|
|||||||
[data.nswindow close];
|
[data.nswindow close];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SDL_VIDEO_OPENGL
|
#ifdef SDL_VIDEO_OPENGL
|
||||||
|
contexts = [data.nscontexts copy];
|
||||||
NSArray *contexts = [data.nscontexts copy];
|
|
||||||
for (SDLOpenGLContext *context in contexts) {
|
for (SDLOpenGLContext *context in contexts) {
|
||||||
/* Calling setWindow:NULL causes the context to remove itself from the context list. */
|
/* Calling setWindow:NULL causes the context to remove itself from the context list. */
|
||||||
[context setWindow:NULL];
|
[context setWindow:NULL];
|
||||||
}
|
}
|
||||||
|
#endif /* SDL_VIDEO_OPENGL */
|
||||||
#endif /* SDL_VIDEO_OPENGL */
|
|
||||||
|
|
||||||
if (window->shaper) {
|
if (window->shaper) {
|
||||||
CFBridgingRelease(window->shaper->driverdata);
|
CFBridgingRelease(window->shaper->driverdata);
|
||||||
|
|||||||
Reference in New Issue
Block a user