2 * Include this BEFORE darkplaces.h because it breaks wrapping
3 * _Static_assert. Cloudwalk has no idea how or why so don't ask.
7 #include "darkplaces.h"
11 #pragma comment(lib, "sdl2.lib")
12 #pragma comment(lib, "sdl2main.lib")
17 // =======================================================================
19 // =======================================================================
21 void Sys_SDL_Shutdown(void)
26 // Sys_Error early in startup might screw with automated
27 // workflows or something if we show the dialog by default.
28 static qbool nocrashdialog = true;
29 void Sys_SDL_Dialog(const char *title, const char *string)
32 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, string, NULL);
35 char *Sys_SDL_GetClipboardData (void)
40 cliptext = SDL_GetClipboardText();
41 if (cliptext != NULL) {
43 allocsize = min(MAX_INPUTLINE, strlen(cliptext) + 1);
44 data = (char *)Z_Malloc (allocsize);
45 dp_strlcpy (data, cliptext, allocsize);
52 void Sys_SDL_Init(void)
54 // we don't know which systems we'll want to init, yet...
56 Sys_Error("SDL_Init failed: %s\n", SDL_GetError());
58 // COMMANDLINEOPTION: sdl: -nocrashdialog disables "Engine Error" crash dialog boxes
59 if(!Sys_CheckParm("-nocrashdialog"))
60 nocrashdialog = false;
63 qbool sys_supportsdlgetticks = true;
64 unsigned int Sys_SDL_GetTicks (void)
66 return SDL_GetTicks();
68 void Sys_SDL_Delay (unsigned int milliseconds)
70 SDL_Delay(milliseconds);
73 int main(int argc, char *argv[])
75 return Sys_Main(argc, argv);