comparison src/video/windx5/SDL_dx5events.c @ 1330:450721ad5436

It's now possible to build SDL without any C runtime at all on Windows, using Visual C++ 2005
author Sam Lantinga <slouken@libsdl.org>
date Mon, 06 Feb 2006 08:28:51 +0000
parents c9b51268668f
children 3692456e7b0f
comparison
equal deleted inserted replaced
1329:bc67bbf87818 1330:450721ad5436
22 22
23 /* CAUTION!!!! If you modify this file, check ../windib/SDL_sysevents.c */ 23 /* CAUTION!!!! If you modify this file, check ../windib/SDL_sysevents.c */
24 24
25 #include "directx.h" 25 #include "directx.h"
26 26
27 #include <stdio.h>
28 #include "SDL_events.h" 27 #include "SDL_events.h"
29 #include "SDL_video.h" 28 #include "SDL_video.h"
30 #include "SDL_error.h" 29 #include "SDL_error.h"
31 #include "SDL_syswm.h" 30 #include "SDL_syswm.h"
31 #include "SDL_stdlib.h"
32 #include "SDL_string.h"
32 #include "SDL_sysevents.h" 33 #include "SDL_sysevents.h"
33 #include "SDL_events_c.h" 34 #include "SDL_events_c.h"
34 #include "SDL_lowvideo.h" 35 #include "SDL_lowvideo.h"
35 #include "SDL_dx5video.h" 36 #include "SDL_dx5video.h"
36 37
109 break; 110 break;
110 case DIERR_NOTINITIALIZED: 111 case DIERR_NOTINITIALIZED:
111 error = "Device not initialized"; 112 error = "Device not initialized";
112 break; 113 break;
113 default: 114 default:
114 sprintf(errbuf, "%s: Unknown DirectInput error: 0x%x", 115 snprintf(errbuf, SDL_arraysize(errbuf),
116 "%s: Unknown DirectInput error: 0x%x",
115 function, code); 117 function, code);
116 break; 118 break;
117 } 119 }
118 if ( ! errbuf[0] ) { 120 if ( ! errbuf[0] ) {
119 sprintf(errbuf, "%s: %s", function, error); 121 snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
120 } 122 }
121 SDL_SetError("%s", errbuf); 123 SDL_SetError("%s", errbuf);
122 return; 124 return;
123 } 125 }
124 126
608 /* Wait for messages and input events */ 610 /* Wait for messages and input events */
609 event = MsgWaitForMultipleObjects(SDL_DIndev, SDL_DIevt, FALSE, 611 event = MsgWaitForMultipleObjects(SDL_DIndev, SDL_DIevt, FALSE,
610 timeout, QS_ALLEVENTS); 612 timeout, QS_ALLEVENTS);
611 if ((event >= WAIT_OBJECT_0) && (event < (WAIT_OBJECT_0+SDL_DIndev))) { 613 if ((event >= WAIT_OBJECT_0) && (event < (WAIT_OBJECT_0+SDL_DIndev))) {
612 DWORD numevents; 614 DWORD numevents;
613 DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE]; 615 static DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE];
614 616
615 event -= WAIT_OBJECT_0; 617 event -= WAIT_OBJECT_0;
616 numevents = INPUT_QSIZE; 618 numevents = INPUT_QSIZE;
617 result = IDirectInputDevice2_GetDeviceData( 619 result = IDirectInputDevice2_GetDeviceData(
618 SDL_DIdev[event], sizeof(DIDEVICEOBJECTDATA), 620 SDL_DIdev[event], sizeof(DIDEVICEOBJECTDATA),