.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "al_get_video_frame" "3alleg5" "" "Allegro reference manual" "" .hy .SH NAME .PP al_get_video_frame - Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include ALLEGRO_BITMAP *al_get_video_frame(ALLEGRO_VIDEO *video) \f[R] .fi .SH DESCRIPTION .PP Returns the current video frame. The bitmap is owned by the video so do not attempt to free it. The bitmap will stay valid until the next call to al_get_video_frame. .PP Videos often do not use square pixels so the recommended way to draw a video frame would be using code like this: .IP .nf \f[C] float scale = 1.0; /* Adjust this to fit your target bitmap dimensions. */ ALLEGRO_BITMAP* frame = al_get_video_frame(video); float sw = al_get_bitmap_width(frame); float sh = al_get_bitmap_height(frame); float dw = scale * al_get_video_scaled_width(video); float dh = scale * al_get_video_scaled_height(video); al_draw_scaled_bitmap(frame, 0, 0, sw, sh, 0, 0, dw, dh, 0); \f[R] .fi .SH SINCE .PP 5.1.0 .SH SEE ALSO .PP al_get_video_scaled_width(3alleg5), al_get_video_scaled_height(3alleg5)