comparison src/video/windx5/SDL_dx5video.c @ 901:fd4a6847ddc0

Date: Thu, 24 Jun 2004 15:13:40 +0300 (EEST) From: Martin_Storsj� Subject: Small patches for SDL/win32 I've tried playing with running SDL compiled for Windows with Wine (and WineX) under Linux. It didn't originally work too well, but I somehow managed to make it work. Most of the fixes was patches to Wine(X), but I also found something in video/windx5/SDL_dx5video.c which, as far as I can tell, actually is a bug in SDL. The result from the COM method Release, which returns the new reference count, is compared to DD_OK. Because QueryInterface is called immediately before, the reference count shouldn't be DD_OK (== 0).
author Sam Lantinga <slouken@libsdl.org>
date Fri, 25 Jun 2004 05:24:50 +0000
parents 31fa08b36380
children 96671ebc50a4
comparison
equal deleted inserted replaced
900:c3c8739f7844 901:fd4a6847ddc0
1321 &IID_IDirectDrawSurface3, (LPVOID *)&SDL_primary); 1321 &IID_IDirectDrawSurface3, (LPVOID *)&SDL_primary);
1322 if ( result != DD_OK ) { 1322 if ( result != DD_OK ) {
1323 SetDDerror("DirectDrawSurface::QueryInterface", result); 1323 SetDDerror("DirectDrawSurface::QueryInterface", result);
1324 return(NULL); 1324 return(NULL);
1325 } 1325 }
1326 result = IDirectDrawSurface_Release(dd_surface1); 1326 IDirectDrawSurface_Release(dd_surface1);
1327 if ( result != DD_OK ) {
1328 SetDDerror("DirectDrawSurface::Release", result);
1329 return(NULL);
1330 }
1331 1327
1332 /* Get the format of the primary DirectDraw surface */ 1328 /* Get the format of the primary DirectDraw surface */
1333 memset(&ddsd, 0, sizeof(ddsd)); 1329 memset(&ddsd, 0, sizeof(ddsd));
1334 ddsd.dwSize = sizeof(ddsd); 1330 ddsd.dwSize = sizeof(ddsd);
1335 ddsd.dwFlags = DDSD_PIXELFORMAT|DDSD_CAPS; 1331 ddsd.dwFlags = DDSD_PIXELFORMAT|DDSD_CAPS;
1336 result = IDirectDrawSurface3_GetSurfaceDesc(SDL_primary, &ddsd); 1332 result = IDirectDrawSurface3_GetSurfaceDesc(SDL_primary, &ddsd);
1337 if ( result != DD_OK ) { 1333 if ( result != DD_OK ) {
1338 SetDDerror("DirectDrawSurface::Release", result); 1334 SetDDerror("DirectDrawSurface::GetSurfaceDesc", result);
1339 return(NULL); 1335 return(NULL);
1340 } 1336 }
1341 if ( ! (ddsd.ddpfPixelFormat.dwFlags&DDPF_RGB) ) { 1337 if ( ! (ddsd.ddpfPixelFormat.dwFlags&DDPF_RGB) ) {
1342 SDL_SetError("Primary DDRAW surface is not RGB format"); 1338 SDL_SetError("Primary DDRAW surface is not RGB format");
1343 return(NULL); 1339 return(NULL);