Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Reaux { namespace OS {
- // debug message types
- enum DebugMessage
- {
- DBG_MSG__NOTICE = 0,
- DBG_MSG__WARNING,
- DBG_MSG__ERROR,
- DBG_MSG__TOTAL
- };
- }}
- // Message output (Microsoft)
- namespace Reaux { namespace OS {
- static void OutputMessage(DebugMessage type, pchar msg, ...)
- {
- if (!msg) return;
- va_list argList;
- va_start(argList, msg);
- #ifdef __REAUX_CONSOLE
- vutf8printf(stdout, msg, &argList);
- #endif
- char buf[4096]; // 4 kb
- StringCchVPrintf(buf, sizeof(buf), msg, argList);
- // Minimize application (If GUI application and FULLCSREEN mode for example...)
- HWND hwnd = FindWindow(REAUX_APPLICATION_WINDOW, NULL);
- if (hwnd)
- {
- ShowWindow(hwnd, SW_MINIMIZE);
- }
- // Show message window
- MessageBox(NULL, msg, "Reaux SDK", MB_OK|MB_APPLMODAL|MB_SETFOREGROUND|MB_TOPMOST|MB_ICONERROR);
- if (type == DBG_MSG__ERROR)
- {
- abort();
- }
- va_end(argList);
- // MiniDupm call...
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement