mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-05-21 21:02:22 +00:00
cocoa: Patched to compile on macOS SDK < 10.10.
Fixes #6586. (cherry picked from commit fa5adcafd52303fde86c64094462303404259d75)
This commit is contained in:
parent
dcd1252368
commit
3f5593d613
|
@ -59,6 +59,9 @@ struct SDL_GLDriverData
|
||||||
- (SDL_Window*)window;
|
- (SDL_Window*)window;
|
||||||
- (void)explicitUpdate;
|
- (void)explicitUpdate;
|
||||||
- (void)dealloc;
|
- (void)dealloc;
|
||||||
|
|
||||||
|
@property (retain, nonatomic) NSOpenGLPixelFormat* openglPixelFormat; // macOS 10.10 has -[NSOpenGLContext pixelFormat] but this handles older OS releases.
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* OpenGL functions */
|
/* OpenGL functions */
|
||||||
|
|
|
@ -76,6 +76,7 @@ DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const
|
||||||
{
|
{
|
||||||
self = [super initWithFormat:format shareContext:share];
|
self = [super initWithFormat:format shareContext:share];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
self.openglPixelFormat = format;
|
||||||
SDL_AtomicSet(&self->dirty, 0);
|
SDL_AtomicSet(&self->dirty, 0);
|
||||||
self->window = NULL;
|
self->window = NULL;
|
||||||
SDL_AtomicSet(&self->swapIntervalSetting, 0);
|
SDL_AtomicSet(&self->swapIntervalSetting, 0);
|
||||||
|
@ -100,7 +101,7 @@ DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const
|
||||||
- (void)movedToNewScreen
|
- (void)movedToNewScreen
|
||||||
{
|
{
|
||||||
if (self->displayLink) {
|
if (self->displayLink) {
|
||||||
CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(self->displayLink, [self CGLContextObj], [[self pixelFormat] CGLPixelFormatObj]);
|
CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(self->displayLink, [self CGLContextObj], [[self openglPixelFormat] CGLPixelFormatObj]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue