From 22704ac2df513d7c8b559965068a09095cce9ffd Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 26 May 2015 09:55:41 -0400 Subject: [PATCH] Cocoa: don't fail outright if we see an unknown display format. Just treat it as ARGB8888. --- src/video/cocoa/SDL_cocoamodes.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index 73b14ed7c..bb8c346ed 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -192,9 +192,16 @@ GetDisplayMode(_THIS, const void *moderef, CVDisplayLinkRef link, SDL_DisplayMod mode->format = SDL_PIXELFORMAT_ARGB8888; break; case 8: /* We don't support palettized modes now */ - default: /* Totally unrecognizable bit depth. */ SDL_free(data); return SDL_FALSE; + default: + /* Totally unrecognizable format. Maybe a new string reported by + CGDisplayModeCopyPixelEncoding() in a future platform SDK. + Just lie and call it 32-bit ARGB for now, so existing programs + don't completely fail on new setups. (most apps don't care about + the actual mode format anyhow.) */ + mode->format = SDL_PIXELFORMAT_ARGB8888; + break; } mode->w = width; mode->h = height;