src/audio/windx5/SDL_dx5audio.c
changeset 453 a6fa62b1be09
parent 375 17976f0f503f
child 469 a1284fd544aa
equal deleted inserted replaced
452:4c5c10383201 453:a6fa62b1be09
    61 	HINSTANCE DSoundDLL;
    61 	HINSTANCE DSoundDLL;
    62 	int dsound_ok;
    62 	int dsound_ok;
    63 
    63 
    64 	/* Version check DSOUND.DLL (Is DirectX okay?) */
    64 	/* Version check DSOUND.DLL (Is DirectX okay?) */
    65 	dsound_ok = 0;
    65 	dsound_ok = 0;
    66 	DSoundDLL = LoadLibrary("DSOUND.DLL");
    66 	DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL"));
    67 	if ( DSoundDLL != NULL ) {
    67 	if ( DSoundDLL != NULL ) {
    68 		/* We just use basic DirectSound, we're okay */
    68 		/* We just use basic DirectSound, we're okay */
    69 		/* Yay! */
    69 		/* Yay! */
    70 		/* Unfortunately, the sound drivers on NT have
    70 		/* Unfortunately, the sound drivers on NT have
    71 		   higher latencies than the audio buffers used
    71 		   higher latencies than the audio buffers used
    93 		/* Now check for DirectX 5 or better - otherwise
    93 		/* Now check for DirectX 5 or better - otherwise
    94 		 * we will fail later in DX5_OpenAudio without a chance
    94 		 * we will fail later in DX5_OpenAudio without a chance
    95 		 * to fall back to the DIB driver. */
    95 		 * to fall back to the DIB driver. */
    96 		if (dsound_ok) {
    96 		if (dsound_ok) {
    97 			/* DirectSoundCaptureCreate was added in DX5 */
    97 			/* DirectSoundCaptureCreate was added in DX5 */
    98 			if (!GetProcAddress(DSoundDLL, "DirectSoundCaptureCreate"))
    98 			if (!GetProcAddress(DSoundDLL, TEXT("DirectSoundCaptureCreate")))
    99 				dsound_ok = 0;
    99 				dsound_ok = 0;
   100 
   100 
   101 		}
   101 		}
   102 		/* Clean up.. */
   102 		/* Clean up.. */
   103 		FreeLibrary(DSoundDLL);
   103 		FreeLibrary(DSoundDLL);
   119 static int DX5_Load(void)
   119 static int DX5_Load(void)
   120 {
   120 {
   121 	int status;
   121 	int status;
   122 
   122 
   123 	DX5_Unload();
   123 	DX5_Unload();
   124 	DSoundDLL = LoadLibrary("DSOUND.DLL");
   124 	DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL"));
   125 	if ( DSoundDLL != NULL ) {
   125 	if ( DSoundDLL != NULL ) {
   126 		DSoundCreate = (void *)GetProcAddress(DSoundDLL,
   126 		DSoundCreate = (void *)GetProcAddress(DSoundDLL,
   127 					"DirectSoundCreate");
   127 					TEXT("DirectSoundCreate"));
   128 	}
   128 	}
   129 	if ( DSoundDLL && DSoundCreate ) {
   129 	if ( DSoundDLL && DSoundCreate ) {
   130 		status = 0;
   130 		status = 0;
   131 	} else {
   131 	} else {
   132 		DX5_Unload();
   132 		DX5_Unload();
   187 };
   187 };
   188 
   188 
   189 static void SetDSerror(const char *function, int code)
   189 static void SetDSerror(const char *function, int code)
   190 {
   190 {
   191 	static const char *error;
   191 	static const char *error;
   192 	static char  errbuf[BUFSIZ];
   192 	static char  errbuf[1024];
   193 
   193 
   194 	errbuf[0] = 0;
   194 	errbuf[0] = 0;
   195 	switch (code) {
   195 	switch (code) {
   196 		case E_NOINTERFACE:
   196 		case E_NOINTERFACE:
   197 			error = 
   197 			error =