comparison test/automated/render/render.c @ 3531:61b7f5821576

On Windows the minimum window size may be larger than 80, so explicitly request the expected rectangle.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 07 Dec 2009 08:01:20 +0000
parents 78db4f7ae2f3
children 0267b8b1595c
comparison
equal deleted inserted replaced
3530:e96be66e3673 3531:61b7f5821576
54 * @return 0 on success. 54 * @return 0 on success.
55 */ 55 */
56 static int render_compare( const char *msg, const SurfaceImage_t *s, int allowable_error ) 56 static int render_compare( const char *msg, const SurfaceImage_t *s, int allowable_error )
57 { 57 {
58 int ret; 58 int ret;
59 SDL_Rect rect;
59 Uint8 pix[4*80*60]; 60 Uint8 pix[4*80*60];
60 SDL_Surface *testsur; 61 SDL_Surface *testsur;
61 62
62 /* Read pixels. */ 63 /* Read pixels. */
63 ret = SDL_RenderReadPixels( NULL, FORMAT, pix, 80*4 ); 64 /* Explicitly specify the rect in case the window isn't expected size... */
65 rect.x = 0;
66 rect.y = 0;
67 rect.w = 80;
68 rect.h = 60;
69 ret = SDL_RenderReadPixels( &rect, FORMAT, pix, 80*4 );
64 if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) ) 70 if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) )
65 return 1; 71 return 1;
66 72
67 /* Create surface. */ 73 /* Create surface. */
68 testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4, 74 testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4,