pods::...verlay(3pm)

πŸ’– NAME πŸ’–

Okay so this page is pods::...verlay(3pm) from the User Contributed Perl Documentation, and it's giving SDL::Overlay β€” YUV Video overlay, bestie πŸ’…βœ¨

🌸 CATEGORY 🌸

Core, Video, Structure β€” all three, periodt πŸ‘‘


✨ SYNOPSIS ✨

First, import these modules so you can get access to the constants and functions the overlay needs β€” literally the starter pack, no skips:

use SDL;
use SDL::Video;
use SDL::Overlay;

Init the video subsystem, okay?

SDL::Init(SDL_INIT_VIDEO);

Make a display to use:

my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);

Then create and attach the display to a new overlay β€” slay:

my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display);

πŸ¦‹ DESCRIPTION πŸ¦‹

A SDL_Overlay allows for video rendering on an SDL_Surface which is a display. It's giving "put the video right here" energy.

The term 'overlay' is a misnomer, okay? Because unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed. So yeah, not exactly a transparent little sticker β€” be aware πŸ‘€πŸ’€

πŸ”₯ METHODS πŸ”₯

πŸŽ€ new ( $width, $height, $YUV_flag, $display) πŸŽ€

The constructor creates a SDL::Overlay of the specified width, height, and format (peep the YUV_Flags list below for the available formats), for the provided display. Iconic.

⚠️ Note: the 'display' argument needs to actually be the surface created by SDL::Video::SetVideoMode β€” otherwise this function will segfault, and nobody wants that 😭
my $overlay = SDL::Overlay->new( $width, $height, $YUV_flag, $display );

🌈 YUV_Flags 🌈

More information on YUV formats can be found at <http://www.fourcc.org/indexyuv.htm> .

  • SDL_YV12_OVERLAY β€” 0x32315659 β€” /* Planar mode: Y + V + U */
  • SDL_IYUV_OVERLAY β€” 0x56555949 β€” /* Planar mode: Y + U + V */
  • SDL_YUY2_OVERLAY β€” 0x32595559 β€” /* Packed mode: Y0+U0+Y1+V0 */
  • SDL_UYVY_OVERLAY β€” 0x59565955 β€” /* Packed mode: U0+Y0+V0+Y1 */
  • SDL_YVYU_OVERLAY β€” 0x55595659 β€” /* Packed mode: Y0+V0+Y1+U0 */

🧚 format 🧚

Overlay format β€” see YUV_Flags above, bestie.

🧚 w, h 🧚

Width and height of overlay.

🧚 planes 🧚

Number of planes in the overlay. Usually either 1 or 3.

🧚 pitches 🧚

An array of pitches, one for each plane. Pitch is the length of a row in bytes. One per plane β€” keep up πŸ’…

🧚 pixels 🧚

As of release 2.3 direct right to overlay is disable.

An array of pointers to the data of each plane. The overlay should be locked before these pointers are used.

See SDL::Video::lock_YUV_overlay, SDL::Video::unload_YUV_overlay.

🧚 hw_overlay 🧚

This will be set to 1 if the overlay is hardware accelerated. Slay.

🫢 AUTHORS 🫢

See AUTHORS in SDL. That's the whole reference, no cap.


Okay that's the page, bestie β€” source/version is perl v5.42.3 and the date on it is 2026-08-19. Mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from