8 * Include this BEFORE darkplaces.h because it breaks wrapping
9 * _Static_assert. Cloudwalk has no idea how or why so don't ask.
13 #include "darkplaces.h"
17 #pragma comment(lib, "sdl2.lib")
18 #pragma comment(lib, "sdl2main.lib")
24 // =======================================================================
26 // =======================================================================
28 void Sys_Shutdown (void)
31 Sys_AllowProfiling(false);
34 fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
40 // Sys_Error early in startup might screw with automated
41 // workflows or something if we show the dialog by default.
42 static qbool nocrashdialog = true;
43 void Sys_SDL_Dialog(const char *title, const char *string)
46 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, string, NULL);
49 char *Sys_GetClipboardData (void)
54 cliptext = SDL_GetClipboardText();
55 if (cliptext != NULL) {
57 allocsize = min(MAX_INPUTLINE, strlen(cliptext) + 1);
58 data = (char *)Z_Malloc (allocsize);
59 strlcpy (data, cliptext, allocsize);
66 void Sys_SDL_Init(void)
68 // we don't know which systems we'll want to init, yet...
70 Sys_Error("SDL_Init failed: %s\n", SDL_GetError());
72 // COMMANDLINEOPTION: sdl: -nocrashdialog disables "Engine Error" crash dialog boxes
73 if(!Sys_CheckParm("-nocrashdialog"))
74 nocrashdialog = false;
77 qbool sys_supportsdlgetticks = true;
78 unsigned int Sys_SDL_GetTicks (void)
80 return SDL_GetTicks();
82 void Sys_SDL_Delay (unsigned int milliseconds)
84 SDL_Delay(milliseconds);