request_video_bitmap(3alleg4)

request_video_bitmap3alleg4

Triple buffering page flip request. allegro game programming library.

Usage

#include <allegro.h>

int request_video_bitmap(BITMAP *bitmap);

Overview

This function is used for triple buffering. It requests a page flip to display the specified video bitmap object, but returns immediately rather than waiting for a retrace. The flip will then take place during the next vertical retrace, but you can carry on running other code in the meantime and use the poll_scroll() routine to detect when the flip has actually taken place. Triple buffering is only possible on certain hardware: see the comments about request_scroll(). Example:

   int current_page;
   BITMAP *video_page[3];
   ...
   /* Create pages for page flipping */
   video_page[0] = create_video_bitmap(SCREEN_W, SCREEN_H);
   video_page[1] = create_video_bitmap(SCREEN_W, SCREEN_H);
   video_page[2] = create_video_bitmap(SCREEN_W, SCREEN_H);
   current_page = 0;
   ...
   /* draw the screen and flip pages */
   draw_screen(video_page[current_page]);
   do {
   } while (poll_scroll());
   request_video_bitmap(video_page[current_page]);
   current_page = (current_page+1)%3;
   ...

Return value

Returns zero on success and non-zero on failure.

Releases

7 releases since Debian 7 (Wheezy); the text changed 1 time.

  1. 7–10
  2. 11–13

From allegro4-doc 2:4.4.3.1-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.