comparison test/automated/render/render.c @ 3435:9f62f47d989b

You can specify the format for pixel data in SDL_RenderReadPixels() and SDL_RenderWritePixels() This code still doesn't quite work yet. :)
author Sam Lantinga <slouken@libsdl.org>
date Mon, 16 Nov 2009 07:13:07 +0000
parents 116f74112e8a
children 5271ce790fed
comparison
equal deleted inserted replaced
3434:147d6ef5be03 3435:9f62f47d989b
65 pix = malloc( 4*80*60 ); 65 pix = malloc( 4*80*60 );
66 if (SDL_ATassert( "malloc", pix!=NULL )) 66 if (SDL_ATassert( "malloc", pix!=NULL ))
67 return 1; 67 return 1;
68 68
69 /* Read pixels. */ 69 /* Read pixels. */
70 ret = SDL_RenderReadPixels( NULL, pix, 80*4 ); 70 ret = SDL_RenderReadPixels( NULL, FORMAT, pix, 80*4 );
71 if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) ) 71 if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) )
72 return 1; 72 return 1;
73 73
74 /* Create surface. */ 74 /* Create surface. */
75 testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4, 75 testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4,