mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Modified files for SDL2.
This commit is contained in:
parent
33a0579735
commit
475f218bcd
33 changed files with 436 additions and 136 deletions
|
|
@ -190,6 +190,7 @@ bool Platform::checkOtherInstances(const char *mutexName)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifndef TORQUE_SDL
|
||||
//--------------------------------------
|
||||
void Platform::AlertOK(const char *windowTitle, const char *message)
|
||||
{
|
||||
|
|
@ -232,6 +233,43 @@ bool Platform::AlertRetry(const char *windowTitle, const char *message)
|
|||
#endif
|
||||
}
|
||||
|
||||
Platform::ALERT_ASSERT_RESULT Platform::AlertAssert(const char *windowTitle, const char *message)
|
||||
{
|
||||
#ifndef TORQUE_TOOLS
|
||||
ShowCursor(true);
|
||||
#endif // TORQUE_TOOLS
|
||||
|
||||
#ifdef UNICODE
|
||||
UTF16 messageUTF[1024], title[512];
|
||||
convertUTF8toUTF16((UTF8 *)windowTitle, title, sizeof(title));
|
||||
convertUTF8toUTF16((UTF8 *)message, messageUTF, sizeof(messageUTF));
|
||||
#else
|
||||
const char* messageUTF = message;
|
||||
const char* title = windowTitle;
|
||||
#endif
|
||||
|
||||
// TODO: Change this to a custom dialog that has Exit, Ignore, Ignore All, and Debug buttons
|
||||
ALERT_ASSERT_RESULT alertResult = ALERT_ASSERT_DEBUG;
|
||||
int result = MessageBox(winState.appWindow, messageUTF, title, MB_ABORTRETRYIGNORE | MB_ICONSTOP | MB_DEFBUTTON2 | MB_TASKMODAL | MB_SETFOREGROUND);
|
||||
switch( result )
|
||||
{
|
||||
case IDABORT:
|
||||
alertResult = ALERT_ASSERT_EXIT;
|
||||
break;
|
||||
case IDIGNORE:
|
||||
alertResult = ALERT_ASSERT_IGNORE;
|
||||
break;
|
||||
default:
|
||||
case IDRETRY:
|
||||
alertResult = ALERT_ASSERT_DEBUG;
|
||||
break;
|
||||
}
|
||||
|
||||
return alertResult;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//--------------------------------------
|
||||
HIMC gIMEContext;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue