- or download this
SV * get_pixel32 (SDL_Surface *surface, int x, int y)
{
...
return sv; //make a modifiable reference using u_ptr's place as th
+e memory :)
}
- or download this
AV * construct_p_matrix ( SDL_Surface *surface )
...
return matrix;
}
- or download this
my $surf32_matrix = SDLx::Surface::pixel_array($screen_surface);
print unpack 'b*', $surf32_matrix->[0][0]; # pixel value at x = 0 a
+nd y =0
#OUTPUT:
# 11111111000000000000000000000000
- or download this
print Dump $surf32_matrix->[0][0];
#OUTPUT:
...
# PV = 0x9e04ac "\0\0\377\0"
# CUR = 4
# LEN = 4
- or download this
if ( SDL::Video::MUSTLOCK($screen_surface) ) {
return if ( SDL::Video::lock_surface($screen_surface) < 0 ); #requ
+ired for pixel operations
...
SDL::Video::unlock_surface($screen_surface)
if ( SDL::Video::MUSTLOCK($screen_surface) );