Work in progress: SDL_RenderReadPixels() should be implemented soon.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404170
This commit is contained in:
parent
960459ec63
commit
df2499a35c
1 changed files with 0 additions and 17 deletions
|
@ -67,26 +67,9 @@ static int render_compare( const char *msg, const SurfaceImage_t *s )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Read pixels. */
|
/* Read pixels. */
|
||||||
#if 0
|
|
||||||
ret = SDL_RenderReadPixels( NULL, pix, 80*4 );
|
ret = SDL_RenderReadPixels( NULL, pix, 80*4 );
|
||||||
if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) )
|
if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) )
|
||||||
return 1;
|
return 1;
|
||||||
#else
|
|
||||||
int i, j;
|
|
||||||
Uint8 *buf = pix;
|
|
||||||
const Uint8 *read_pix;
|
|
||||||
Uint8 *write_pix;
|
|
||||||
for (j=0; j<s->height; j++) {
|
|
||||||
for (i=0; i<s->width; i++) {
|
|
||||||
read_pix = &s->pixel_data[ (j*80 + i) * s->bytes_per_pixel ];
|
|
||||||
write_pix = &buf[ (j*80 + i) * 4 ];
|
|
||||||
write_pix[0] = read_pix[0];
|
|
||||||
write_pix[1] = read_pix[1];
|
|
||||||
write_pix[2] = read_pix[2];
|
|
||||||
write_pix[3] = SDL_ALPHA_OPAQUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Create surface. */
|
/* Create surface. */
|
||||||
testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4,
|
testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue