Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

set_display_switch_mode(3alleg4) [redhat man page]

set_display_switch_mode(3alleg4)				  Allegro manual				  set_display_switch_mode(3alleg4)

NAME
set_display_switch_mode - Tells Allegro how the program handles background switching. SYNOPSIS
#include <allegro.h> int set_display_switch_mode(int mode); DESCRIPTION
Sets how the program should handle being switched into the background, if the user tabs away from it. Not all of the possible modes will be supported by every graphics driver on every platform. The available modes are: SWITCH_NONE Disables switching. This is the default in single-tasking systems like DOS. It may be supported on other platforms, but you should use it with caution, because your users won't be impressed if they want to switch away from your program, but you don't let them! SWITCH_PAUSE Pauses the program whenever it is in the background. Execution will be resumed as soon as the user switches back to it. This is the default in most fullscreen multitasking environments, for example the Linux console, but not under Windows. SWITCH_AMNESIA Like SWITCH_PAUSE, but this mode doesn't bother to remember the contents of video memory, so the screen, and any video bitmaps that you have created, will be erased after the user switches away and then back to your program. This is not a terribly useful mode to have, but it is the default for the fullscreen drivers under Windows because DirectDraw is too dumb to implement anything better. SWITCH_BACKGROUND The program will carry on running in the background, with the screen bitmap temporarily being pointed at a memory buffer for the fullscreen drivers. You must take special care when using this mode, because bad things will happen if the screen bitmap gets changed around when your program isn't expecting it (see below). SWITCH_BACKAMNESIA Like SWITCH_BACKGROUND, but this mode doesn't bother to remember the contents of video memory (see SWITCH_AMNESIA). It is again the only mode supported by the fullscreen drivers under Windows that lets the program keep running in the background. Note that you should be very careful when you are using graphics routines in the switching context: you must always call acquire_screen() before the start of any drawing code onto the screen and not release it until you are completely finished, because the automatic locking mechanism may not be good enough to work when the program runs in the background or has just been raised in the foreground. RETURN VALUE
Returns zero on success, invalidating at the same time all callbacks previously registered with set_display_switch_callback(). Returns -1 if the requested mode is not currently possible. SEE ALSO
set_display_switch_callback(3alleg4), get_display_switch_mode(3alleg4), exmidi(3alleg4), exswitch(3alleg4) Allegro version 4.4.2 set_display_switch_mode(3alleg4)

Check Out this Related Man Page

exswitch(3alleg4)						  Allegro manual						 exswitch(3alleg4)

NAME
exswitch - Controlling the console switch mode for background running. Allegro game programming library. SYNOPSIS
#include <allegro.h> Example exswitch DESCRIPTION
This program shows how to control the console switching mode, and let your program run in the background. These functions don't apply to every platform and driver, for example you can't control the switching mode from a DOS program. Yes, I know the fractal drawing is very slow: that's the point! This is so you can easily check whether it goes on working in the back- ground after you switch away from the app. Depending on the type of selected switching mode, you will see whether the contents of the screen are preserved or not. SEE ALSO
BITMAP(3alleg4), END_OF_FUNCTION(3alleg4), END_OF_MAIN(3alleg4), LOCK_FUNCTION(3alleg4), LOCK_VARIABLE(3alleg4), PALETTE(3alleg4), SCREEN_H(3alleg4), SCREEN_W(3alleg4), acquire_bitmap(3alleg4), acquire_screen(3alleg4), allegro_error(3alleg4), allegro_exit(3alleg4), allegro_init(3alleg4), allegro_message(3alleg4), bitmap_color_depth(3alleg4), blit(3alleg4), clear_to_color(3alleg4), create_sub_bit- map(3alleg4), desktop_palette(3alleg4), destroy_bitmap(3alleg4), font(3alleg4), get_display_switch_mode(3alleg4), gfx_mode_select_ex(3alleg4), install_int(3alleg4), install_keyboard(3alleg4), install_mouse(3alleg4), install_timer(3alleg4), key- pressed(3alleg4), makecol(3alleg4), palette_color(3alleg4), putpixel(3alleg4), readkey(3alleg4), rectfill(3alleg4), release_bit- map(3alleg4), release_screen(3alleg4), screen(3alleg4), set_color_depth(3alleg4), set_display_switch_callback(3alleg4), set_dis- play_switch_mode(3alleg4), set_gfx_mode(3alleg4), set_palette(3alleg4), textout_centre_ex(3alleg4), textprintf_centre_ex(3alleg4) Allegro version 4.4.2 exswitch(3alleg4)
Man Page