SDL2-FFI
view release on metacpan or search on metacpan
lib/SDL2/render.pm view on Meta::CPAN
=item C<texture> - the texture to query
=back
Returns the current C<:blendMode> on success or a negative error code on
failure; call C<SDL_GetError( )> for more information.
=head2 C<SDL_SetTextureScaleMode( ... )>
Set the scale mode used for texture scale operations.
SDL_SetTextureScaleMode( $texture, $scaleMode );
If the scale mode is not supported, the closest supported mode is chosen.
Expected parameters include:
=over
=item C<texture> - The texture to update.
=item C<scaleMode> - the SDL_ScaleMode to use for texture scaling.
=back
Returns C<0> on success, or C<-1> if the texture is not valid.
=head2 C<SDL_GetTextureScaleMode( ... )>
Get the scale mode used for texture scale operations.
my $ok = SDL_GetTextureScaleMode( $texture );
Expected parameters include:
=over
=item C<texture> - the texture to query.
=back
Returns the current scale mode on success, or C<-1> if the texture is not
valid.
=head2 C<SDL_UpdateTexture( ... )>
Update the given texture rectangle with new pixel data.
my $rect = SDL2::Rect->new( { x => 0, y => ..., w => $surface->w, h => $surface->h } );
SDL_UpdateTexture( $texture, $rect, $surface->pixels, $surface->pitch );
The pixel data must be in the pixel format of the texture. Use L<<
C<SDL_QueryTexture( ... )>|/C<SDL_QueryTexture( ... )> >> to query the pixel
format of the texture.
This is a fairly slow function, intended for use with static textures that do
not change often.
If the texture is intended to be updated often, it is preferred to create the
texture as streaming and use the locking functions referenced below. While this
function will work with streaming textures, for optimization reasons you may
not get the pixels back if you lock the texture afterward.
Expected parameters include:
=over
=item C<texture> - the texture to update
=item C<rect> - an L<SDL2::Rect> structure representing the area to update, or undef to update the entire texture
=item C<pixels> - the raw pixel data in the format of the texture
=item C<pitch> - the number of bytes in a row of pixel data, including padding between lines
=back
Returns C<0> on success or a negative error code on failure; call
C<SDL_GetError( )> for more information.
=head2 C<SDL_UpdateYUVTexture( ... )>
Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
SDL_UpdateYUVTexture( $texture, $rect, $yPlane, $yPitch, $uPlane, $uPitch, $vPlane, $vPitch );
You can use L<< C<SDL_UpdateTexture( ... )>|/C<SDL_UpdateTexture( ... )> >> as
long as your pixel data is a contiguous block of Y and U/V planes in the proper
order, but this function is available if your pixel data is not contiguous.
Expected parameters include:
=over
=item C<texture> - the texture to update
=item C<rect> - a pointer to the rectangle of pixels to update, or undef to update the entire texture
=item C<Yplane> - the raw pixel data for the Y plane
=item C<Ypitch> - the number of bytes between rows of pixel data for the Y plane
=item C<Uplane> - the raw pixel data for the U plane
=item C<Upitch> - the number of bytes between rows of pixel data for the U plane
=item C<Vplane> - the raw pixel data for the V plane
=item C<Vpitch> - the number of bytes between rows of pixel data for the V plane
=back
Returns C<0> on success or -1 if the texture is not valid; call C<SDL_GetError(
)> for more information.
=head2 C<SDL_UpdateNVTexture( ... )>
Update a rectangle within a planar NV12 or NV21 texture with new pixels.
SDL_UpdateNVTexture( $texture, $rect, $yPlane, $yPitch, $uPlane, $uPitch );
( run in 1.105 second using v1.01-cache-2.11-cpan-f56aa216473 )