]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_sdl.c
PROTOCOL_DARKPLACES5
[xonotic/darkplaces.git] / sys_sdl.c
index bc48f44049ef53cf6a54215ddded806de7ed7c37..3bdbc7e53a7ba931ce29fe6774101ebe12d1c2a9 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -46,6 +46,10 @@ void Sys_Error (const char *error, ...)
        va_end (argptr);
        fprintf(stderr, "Error: %s\n", string);
 
+       Con_Print ("Quake Error: ");
+       Con_Print (string);
+       Con_Print ("\n");
+
        Host_Shutdown ();
        exit (1);
 }
@@ -178,6 +182,33 @@ void Sys_Sleep(int milliseconds)
        SDL_Delay(milliseconds);
 }
 
+char *Sys_GetClipboardData (void)
+{
+#ifdef WIN32
+       char *data = NULL;
+       char *cliptext;
+
+       if (OpenClipboard (NULL) != 0)
+       {
+               HANDLE hClipboardData;
+
+               if ((hClipboardData = GetClipboardData (CF_TEXT)) != 0)
+               {
+                       if ((cliptext = GlobalLock (hClipboardData)) != 0) 
+                       {
+                               data = malloc (GlobalSize(hClipboardData)+1);
+                               strcpy (data, cliptext);
+                               GlobalUnlock (hClipboardData);
+                       }
+               }
+               CloseClipboard ();
+       }
+       return data;
+#else
+       return NULL;
+#endif
+}
+
 int SDL_main (int argc, char *argv[])
 {
        double frameoldtime, framenewtime;