2020-01-05 20:40:18 +00:00
|
|
|
#include <CoreFoundation/CoreFoundation.h>
|
|
|
|
#include "SDL.h"
|
|
|
|
|
|
|
|
void Mac_I_FatalError(const char* errortext)
|
|
|
|
{
|
|
|
|
// Close window or exit fullscreen and release mouse capture
|
|
|
|
SDL_Quit();
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-01-05 20:40:18 +00:00
|
|
|
const CFStringRef errorString = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault,
|
|
|
|
errortext, kCFStringEncodingASCII, kCFAllocatorNull );
|
|
|
|
if ( NULL != errorString )
|
|
|
|
{
|
|
|
|
CFOptionFlags dummy;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-01-05 20:40:18 +00:00
|
|
|
CFUserNotificationDisplayAlert( 0, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL,
|
|
|
|
CFSTR( "Fatal Error" ), errorString, CFSTR( "Exit" ), NULL, NULL, &dummy );
|
|
|
|
CFRelease( errorString );
|
|
|
|
}
|
|
|
|
}
|