bmap_for_screen (BMAP*,
var modify, var delay);
Grabs the screen image into a bitmap. The bitmap can then be displayed as a button or window in a panel, to indicate screenshots of saved games.
Parameters:
BMAP* -
pointer to a BMAP of the desired size.
modify - 1 for marking the bitmap as modified for game_save instructions (slower).
delay - 1 for immediately grabbing the screen, 0 for waiting for the next screen update.
Returns:
BMAP* pointer if successful, 0 otherwise.
Modifies:
BMAP* - the content will be overwritten by the screenshot. The bitmap will be marked as modified for game_save instructions.
Remarks:
- The screen image is adapted to the bitmap size.
-
When delay is set to 0,
the screen contains the current rendering state; otherwise it contains the state of one frame before.
The
modified bitmap can be saved by game_save one frame cycle after the
instruction the earliest (insert wait (1); between the bmap_for_screen and game_save calls).
Speed:
Slow
Example:
BMAP* screen_shot_map = "emptypanel.pcx";
// copies the screen into a bitmap and saves the modified bmap in the game score
function grab_screen() {
bmap_for_screen (screen_shot_map, 1, 0);
wait (1); // wait 1 frame until the bitmap can be saved
game_save (app_name, 0, SV_INFO + SV_BMAPS);
}
See also:
file_for_screen, game_save
► latest
version online