src/video/windx5/SDL_dx5video.c
changeset 901 fd4a6847ddc0
parent 833 31fa08b36380
child 971 96671ebc50a4
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);