]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_sdl.c
Uncomment the texture binding check in R_Mesh_TexBind so that the engine makes less...
[xonotic/darkplaces.git] / sys_sdl.c
index 228c0a49f627449efa432e3567cb996d9cfbb48a..d3564bac89fb0a76a699f9da6ddd092ef9b213ed 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -1,9 +1,5 @@
 
 #ifdef WIN32
-#ifdef _MSC_VER
-#pragma comment(lib, "sdl.lib")
-#pragma comment(lib, "sdlmain.lib")
-#endif
 #include <io.h>
 #include "conio.h"
 #else
 
 #include <SDL.h>
 
+#ifdef WIN32
+#ifdef _MSC_VER
+#if SDL_MAJOR_VERSION == 1
+#pragma comment(lib, "sdl.lib")
+#pragma comment(lib, "sdlmain.lib")
+#else
+#pragma comment(lib, "sdl2.lib")
+#pragma comment(lib, "sdl2main.lib")
+#endif
+#endif
+#endif
+
 #include "quakedef.h"
 
 // =======================================================================
@@ -59,6 +67,10 @@ void Sys_Error (const char *error, ...)
 
        Con_Printf ("Quake Error: %s\n", string);
 
+#ifdef WIN32
+       MessageBox(NULL, string, "Quake Error", MB_OK | MB_SETFOREGROUND | MB_ICONSTOP);
+#endif
+
        Host_Shutdown ();
        exit (1);
 }
@@ -161,7 +173,21 @@ char *Sys_ConsoleInput(void)
 
 char *Sys_GetClipboardData (void)
 {
-#ifdef WIN32
+#if SDL_MAJOR_VERSION != 1
+       char *data = NULL;
+       char *cliptext;
+
+       cliptext = SDL_GetClipboardText();
+       if (cliptext != NULL) {
+               size_t allocsize;
+               allocsize = strlen(cliptext) + 1;
+               data = (char *)Z_Malloc (allocsize);
+               strlcpy (data, cliptext, allocsize);
+               SDL_free(cliptext);
+       }
+
+       return data;
+#elif defined(WIN32)
        char *data = NULL;
        char *cliptext;