comparison src/video/win32/SDL_win32video.c @ 4500:eff4e88cc1e8

Added Windows clipboard support
author Sam Lantinga <slouken@libsdl.org>
date Thu, 08 Jul 2010 05:43:34 -0700
parents 3e69e077cb95
children 9faebccfefb3
comparison
equal deleted inserted replaced
4499:c2ebe3e020c6 4500:eff4e88cc1e8
26 #include "SDL_mouse.h" 26 #include "SDL_mouse.h"
27 #include "../SDL_sysvideo.h" 27 #include "../SDL_sysvideo.h"
28 #include "../SDL_pixels_c.h" 28 #include "../SDL_pixels_c.h"
29 29
30 #include "SDL_win32video.h" 30 #include "SDL_win32video.h"
31 #include "SDL_win32clipboard.h"
31 #include "SDL_d3drender.h" 32 #include "SDL_d3drender.h"
32 #include "SDL_gdirender.h" 33 #include "SDL_gdirender.h"
33 34
34 /* Initialization/Query functions */ 35 /* Initialization/Query functions */
35 static int WIN_VideoInit(_THIS); 36 static int WIN_VideoInit(_THIS);
36 static void WIN_VideoQuit(_THIS); 37 static void WIN_VideoQuit(_THIS);
38
39 /* Sets an error message based on GetLastError() */
40 void
41 WIN_SetError(const char *prefix)
42 {
43 TCHAR buffer[1024];
44 char *message;
45 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
46 buffer, SDL_arraysize(buffer), NULL);
47 message = WIN_StringToUTF8(buffer);
48 SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message);
49 SDL_free(message);
50 }
37 51
38 /* WIN32 driver bootstrap functions */ 52 /* WIN32 driver bootstrap functions */
39 53
40 static int 54 static int
41 WIN_Available(void) 55 WIN_Available(void)
161 device->GL_GetSwapInterval = WIN_GL_GetSwapInterval; 175 device->GL_GetSwapInterval = WIN_GL_GetSwapInterval;
162 device->GL_SwapWindow = WIN_GL_SwapWindow; 176 device->GL_SwapWindow = WIN_GL_SwapWindow;
163 device->GL_DeleteContext = WIN_GL_DeleteContext; 177 device->GL_DeleteContext = WIN_GL_DeleteContext;
164 #endif 178 #endif
165 179
180 device->SetClipboardText = WIN_SetClipboardText;
181 device->GetClipboardText = WIN_GetClipboardText;
182 device->HasClipboardText = WIN_HasClipboardText;
183
166 device->free = WIN_DeleteDevice; 184 device->free = WIN_DeleteDevice;
167 185
168 return device; 186 return device;
169 } 187 }
170 188