Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > bbd6c195accb6dc3ffbe1b07ef155953 > files > 119

allegro5-devel-5.0.3-1.fc15.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Display routines</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="generator" content="pandoc" />
  <link rel="stylesheet" href="pandoc.css" type="text/css" />
  <script type="text/javascript" src="autosuggest.js"></script>
  <script type="text/javascript" src="search_index.js"></script>
</head>
<body>
<div class="sidebar">

<div><ul
><li
  ><a href="index.html"
    ><strong
      >Contents</strong
      ></a
    ></li
  ><li
  ><a href="config.html"
    >Configuration files</a
    ></li
  ><li
  ><a href="display.html"
    >Display</a
    ></li
  ><li
  ><a href="events.html"
    >Events</a
    ></li
  ><li
  ><a href="file.html"
    >File I/O</a
    ></li
  ><li
  ><a href="fshook.html"
    >Filesystem</a
    ></li
  ><li
  ><a href="fixed.html"
    >Fixed point math</a
    ></li
  ><li
  ><a href="graphics.html"
    >Graphics</a
    ></li
  ><li
  ><a href="joystick.html"
    >Joystick</a
    ></li
  ><li
  ><a href="keyboard.html"
    >Keyboard</a
    ></li
  ><li
  ><a href="memory.html"
    >Memory</a
    ></li
  ><li
  ><a href="mouse.html"
    >Mouse</a
    ></li
  ><li
  ><a href="path.html"
    >Path</a
    ></li
  ><li
  ><a href="state.html"
    >State</a
    ></li
  ><li
  ><a href="system.html"
    >System</a
    ></li
  ><li
  ><a href="threads.html"
    >Threads</a
    ></li
  ><li
  ><a href="time.html"
    >Time</a
    ></li
  ><li
  ><a href="timer.html"
    >Timer</a
    ></li
  ><li
  ><a href="transformations.html"
    >Transformations</a
    ></li
  ><li
  ><a href="utf8.html"
    >UTF-8</a
    ></li
  ><li
  ><a href="misc.html"
    >Miscellaneous</a
    ></li
  ><li
  ><a href="platform.html"
    >Platform-specific</a
    ></li
  ><li
  ><a href="direct3d.html"
    >Direct3D</a
    ></li
  ><li
  ><a href="opengl.html"
    >OpenGL</a
    ></div>
</li
  ></ul
><div><ul
><li
  ><a href="index.html#addons"
    ><strong
      >Addons</strong
      ></a
    ></li
  ><li
  ><a href="audio.html"
    >Audio addon</a
    ></li
  ><li
  ><a href="acodec.html"
    >Audio codecs</a
    ></li
  ><li
  ><a href="color.html"
    >Color addon</a
    ></li
  ><li
  ><a href="font.html"
    >Font addons</a
    ></li
  ><li
  ><a href="image.html"
    >Image I/O addon</a
    ></li
  ><li
  ><a href="memfile.html"
    >Memfile addon</a
    ></li
  ><li
  ><a href="native_dialog.html"
    >Native dialogs addon</a
    ></li
  ><li
  ><a href="physfs.html"
    >PhysicsFS addon</a
    ></li
  ><li
  ><a href="primitives.html"
    >Primitives addon</a
    ></div>
</li
  ></ul
><div class="searchbox">
<script type="text/javascript">
function on_search(index, control) {
    for (i = 0; i < search_index.length; i++) {
        if (search_index[i] == control.keywords[index]) {
            break;
        }
    }
    location.href = search_urls[i];
}
</script>Search<br /> <input type="text" name="q" id="q" size="15" autocomplete="off" /><br /><script type="text/javascript"> new autosuggest("q", search_index, null, on_search); </script>
</div>

</div>

<div class="content">


<h1 class="title">Display routines</h1>
<div id="TOC"
><ul
  ><li
    ><a href="#display-creation"
      >Display creation</a
      ><ul
      ><li
	><a href="#allegro_display"
	  >ALLEGRO_DISPLAY</a
	  ></li
	><li
	><a href="#al_create_display"
	  >al_create_display</a
	  ></li
	><li
	><a href="#al_destroy_display"
	  >al_destroy_display</a
	  ></li
	><li
	><a href="#al_get_new_display_flags"
	  >al_get_new_display_flags</a
	  ></li
	><li
	><a href="#al_get_new_display_refresh_rate"
	  >al_get_new_display_refresh_rate</a
	  ></li
	><li
	><a href="#al_get_new_window_position"
	  >al_get_new_window_position</a
	  ></li
	><li
	><a href="#al_set_new_display_option"
	  >al_set_new_display_option</a
	  ></li
	><li
	><a href="#al_get_new_display_option"
	  >al_get_new_display_option</a
	  ></li
	><li
	><a href="#al_reset_new_display_options"
	  >al_reset_new_display_options</a
	  ></li
	><li
	><a href="#al_set_new_display_flags"
	  >al_set_new_display_flags</a
	  ></li
	><li
	><a href="#al_set_new_display_refresh_rate"
	  >al_set_new_display_refresh_rate</a
	  ></li
	><li
	><a href="#al_set_new_window_position"
	  >al_set_new_window_position</a
	  ></li
	></ul
      ></li
    ><li
    ><a href="#display-operations"
      >Display operations</a
      ><ul
      ><li
	><a href="#al_acknowledge_resize"
	  >al_acknowledge_resize</a
	  ></li
	><li
	><a href="#al_flip_display"
	  >al_flip_display</a
	  ></li
	><li
	><a href="#al_get_backbuffer"
	  >al_get_backbuffer</a
	  ></li
	><li
	><a href="#al_get_display_flags"
	  >al_get_display_flags</a
	  ></li
	><li
	><a href="#al_get_display_format"
	  >al_get_display_format</a
	  ></li
	><li
	><a href="#al_get_display_height"
	  >al_get_display_height</a
	  ></li
	><li
	><a href="#al_get_display_refresh_rate"
	  >al_get_display_refresh_rate</a
	  ></li
	><li
	><a href="#al_get_display_width"
	  >al_get_display_width</a
	  ></li
	><li
	><a href="#al_get_window_position"
	  >al_get_window_position</a
	  ></li
	><li
	><a href="#al_inhibit_screensaver"
	  >al_inhibit_screensaver</a
	  ></li
	><li
	><a href="#al_resize_display"
	  >al_resize_display</a
	  ></li
	><li
	><a href="#al_set_display_icon"
	  >al_set_display_icon</a
	  ></li
	><li
	><a href="#al_get_display_option"
	  >al_get_display_option</a
	  ></li
	><li
	><a href="#al_set_window_position"
	  >al_set_window_position</a
	  ></li
	><li
	><a href="#al_set_window_title"
	  >al_set_window_title</a
	  ></li
	><li
	><a href="#al_toggle_display_flag"
	  >al_toggle_display_flag</a
	  ></li
	><li
	><a href="#al_update_display_region"
	  >al_update_display_region</a
	  ></li
	><li
	><a href="#al_wait_for_vsync"
	  >al_wait_for_vsync</a
	  ></li
	><li
	><a href="#al_get_display_event_source"
	  >al_get_display_event_source</a
	  ></li
	></ul
      ></li
    ><li
    ><a href="#fullscreen-display-modes"
      >Fullscreen display modes</a
      ><ul
      ><li
	><a href="#allegro_display_mode"
	  >ALLEGRO_DISPLAY_MODE</a
	  ></li
	><li
	><a href="#al_get_display_mode"
	  >al_get_display_mode</a
	  ></li
	><li
	><a href="#al_get_num_display_modes"
	  >al_get_num_display_modes</a
	  ></li
	></ul
      ></li
    ><li
    ><a href="#monitors"
      >Monitors</a
      ><ul
      ><li
	><a href="#allegro_monitor_info"
	  >ALLEGRO_MONITOR_INFO</a
	  ></li
	><li
	><a href="#al_get_new_display_adapter"
	  >al_get_new_display_adapter</a
	  ></li
	><li
	><a href="#al_set_new_display_adapter"
	  >al_set_new_display_adapter</a
	  ></li
	><li
	><a href="#al_get_monitor_info"
	  >al_get_monitor_info</a
	  ></li
	><li
	><a href="#al_get_num_video_adapters"
	  >al_get_num_video_adapters</a
	  ></li
	></ul
      ></li
    ></ul
  ></div
>
<p
>These functions are declared in the main Allegro header file:</p
><pre
><code
  >#include &lt;allegro5/allegro.h&gt;
</code
  ></pre
><h1 id="display-creation"
><a href="#TOC"
  >Display creation</a
  ></h1
><h2 id="allegro_display"
><a href="#TOC"
  >ALLEGRO_DISPLAY</a
  ></h2
><pre
><code
  >typedef struct ALLEGRO_DISPLAY ALLEGRO_DISPLAY;
</code
  ></pre
><p
>An opaque type representing an open display or window.</p
><h2 id="al_create_display"
><a href="#TOC"
  >al_create_display</a
  ></h2
><pre
><code
  >ALLEGRO_DISPLAY *al_create_display(int w, int h)
</code
  ></pre
><p
>Create a display, or window, with the specified dimensions. The parameters of the display are determined by the last calls to al_set_new_display_*. Default parameters are used if none are set explicitly. Creating a new display will automatically make it the active one, with the backbuffer selected for drawing.</p
><p
>Returns NULL on error.</p
><p
>Each display has a distinct OpenGL rendering context associated with it. See <a href="graphics.html#al_set_target_bitmap"
  >al_set_target_bitmap</a
  > for the discussion about rendering contexts.</p
><p
>See also: <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  >, <a href="display.html#al_set_new_display_option"
  >al_set_new_display_option</a
  >, <a href="display.html#al_set_new_display_refresh_rate"
  >al_set_new_display_refresh_rate</a
  >, <a href="display.html#al_set_new_display_adapter"
  >al_set_new_display_adapter</a
  >, <a href="display.html#al_set_window_position"
  >al_set_window_position</a
  ></p
><h2 id="al_destroy_display"
><a href="#TOC"
  >al_destroy_display</a
  ></h2
><pre
><code
  >void al_destroy_display(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Destroy a display.</p
><p
>If the target bitmap of the calling thread is tied to the display, then it implies a call to &quot;al_set_target_bitmap(NULL);&quot; before the display is destroyed.</p
><p
>That special case notwithstanding, you should make sure no threads are currently targeting a bitmap which is tied to the display before you destroy it.</p
><p
>See also: <a href="graphics.html#al_set_target_bitmap"
  >al_set_target_bitmap</a
  ></p
><h2 id="al_get_new_display_flags"
><a href="#TOC"
  >al_get_new_display_flags</a
  ></h2
><pre
><code
  >int al_get_new_display_flags(void)
</code
  ></pre
><p
>Get the display flags to be used when creating new displays on the calling thread.</p
><p
>See also: <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  >, <a href="display.html#al_toggle_display_flag"
  >al_toggle_display_flag</a
  ></p
><h2 id="al_get_new_display_refresh_rate"
><a href="#TOC"
  >al_get_new_display_refresh_rate</a
  ></h2
><pre
><code
  >int al_get_new_display_refresh_rate(void)
</code
  ></pre
><p
>Get the requested refresh rate to be used when creating new displays on the calling thread.</p
><p
>See also: <a href="display.html#al_set_new_display_refresh_rate"
  >al_set_new_display_refresh_rate</a
  ></p
><h2 id="al_get_new_window_position"
><a href="#TOC"
  >al_get_new_window_position</a
  ></h2
><pre
><code
  >void al_get_new_window_position(int *x, int *y)
</code
  ></pre
><p
>Get the position where new non-fullscreen displays created by the calling thread will be placed.</p
><p
>See also: <a href="display.html#al_set_new_window_position"
  >al_set_new_window_position</a
  ></p
><h2 id="al_set_new_display_option"
><a href="#TOC"
  >al_set_new_display_option</a
  ></h2
><pre
><code
  >void al_set_new_display_option(int option, int value, int importance)
</code
  ></pre
><p
>Set an extra display option, to be used when creating new displays on the calling thread. Display options differ from display flags, and specify some details of the context to be created within the window itself. These mainly have no effect on Allegro itself, but you may want to specify them, for example if you want to use multisampling.</p
><p
>The 'importance' parameter can be either:</p
><ul
><li
  >ALLEGRO_REQUIRE - The display will not be created if the setting can not be met.</li
  ><li
  >ALLEGRO_SUGGEST - If the setting is not available, the display will be created anyway. FIXME: We need a way to query the settings back from a created display.</li
  ><li
  >ALLEGRO_DONTCARE - If you added a display option with one of the above two settings before, it will be removed again. Else this does nothing.</li
  ></ul
><p
>The supported options are:</p
><ul
><li
  >ALLEGRO_RED_SIZE</li
  ><li
  >ALLEGRO_GREEN_SIZE</li
  ><li
  >ALLEGRO_BLUE_SIZE</li
  ><li
  >ALLEGRO_ALPHA_SIZE</li
  ><li
  >ALLEGRO_COLOR_SIZE</li
  ><li
  >ALLEGRO_RED_SHIFT</li
  ><li
  >ALLEGRO_GREEN_SHIFT</li
  ><li
  >ALLEGRO_BLUE_SHIFT</li
  ><li
  >ALLEGRO_ALPHA_SHIFT: These settings can be used to specify the pixel layout the display should use.</li
  ><li
  >ALLEGRO_ACC_RED_SIZE</li
  ><li
  >ALLEGRO_ACC_GREEN_SIZE</li
  ><li
  >ALLEGRO_ACC_BLUE_SIZE</li
  ><li
  >ALLEGRO_ACC_ALPHA_SIZE: This and the preceding three settings can be used to define the required accumulation buffer size.</li
  ><li
  >ALLEGRO_STEREO: Whether the display is a stereo display.</li
  ><li
  >ALLEGRO_AUX_BUFFERS: Number of auxiliary buffers the display should have.</li
  ><li
  >ALLEGRO_DEPTH_SIZE: How many depth buffer (z-buffer) bits to use.</li
  ><li
  >ALLEGRO_STENCIL_SIZE: How many bits to use for the stencil buffer.</li
  ><li
  >ALLEGRO_SAMPLE_BUFFERS: Whether to use multisampling (1) or not (0).</li
  ><li
  >ALLEGRO_SAMPLES: If the above is 1, the number of samples to use per pixel. Else 0.</li
  ><li
  >ALLEGRO_RENDER_METHOD: 0 if hardware acceleration is not used with this display.</li
  ><li
  >ALLEGRO_FLOAT_COLOR: Whether to use floating point color components.</li
  ><li
  >ALLEGRO_FLOAT_DEPTH: Whether to use a floating point depth buffer.</li
  ><li
  >ALLEGRO_SINGLE_BUFFER: Whether the display uses a single buffer (1) or another update method (0).</li
  ><li
  >ALLEGRO_SWAP_METHOD: If the above is 0, this is set to 1 to indicate the display is using a copying method to make the next buffer in the flip chain available, or to 2 to indicate a flipping or other method.</li
  ><li
  >ALLEGRO_COMPATIBLE_DISPLAY: Indicates if Allegro's graphics functions can use this display. If you request a display not useable by Allegro, you can still use for example OpenGL to draw graphics.</li
  ><li
  >ALLEGRO_UPDATE_DISPLAY_REGION: Set to 1 if the display is capable of updating just a region, and 0 if calling <a href="display.html#al_update_display_region"
    >al_update_display_region</a
    > is equivalent to <a href="display.html#al_flip_display"
    >al_flip_display</a
    >.</li
  ><li
  >ALLEGRO_VSYNC: Set to 1 to tell the driver to wait for vsync in <a href="display.html#al_flip_display"
    >al_flip_display</a
    >, or to 2 to force vsync off. The default of 0 means that Allegro does not try to modify the vsync behavior so it may be on or off. Note that even in the case of 1 or 2 it is possile to override the vsync behavior in the graphics driver so you should not rely on it.</li
  ><li
  >ALLEGRO_MAX_BITMAP_SIZE: When queried this returns the maximum size (width as well as height) a bitmap can have for this display. Calls to <a href="graphics.html#al_create_bitmap"
    >al_create_bitmap</a
    > or <a href="graphics.html#al_load_bitmap"
    >al_load_bitmap</a
    > for bitmaps larger than this size will fail. It does not apply to memory bitmaps which always can have arbitrary size (but are slow for drawing).</li
  ><li
  >ALLEGRO_SUPPORT_NPOT_BITMAP: Set to 1 if textures used for bitmaps on this display can have a size which is not a power of two. This is mostly useful if you use Allegro to load textures as otherwise only power-of-two textures will be used internally as bitmap storage.</li
  ><li
  >ALLEGRO_CAN_DRAW_INTO_BITMAP: Set to 1 if you can use <a href="graphics.html#al_set_target_bitmap"
    >al_set_target_bitmap</a
    > on bitmaps of this display to draw into them. If this is not the case software emulation will be used when drawing into display bitmaps (which can be very slow).</li
  ><li
  >ALLEGRO_SUPPORT_SEPARATE_ALPHA: This is set to 1 if the <a href="graphics.html#al_set_separate_blender"
    >al_set_separate_blender</a
    > function is supported. Otherwise the alpha parameters will be ignored.</li
  ></ul
><p
>FIXME: document them all in detail</p
><p
>See also: <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  ></p
><h2 id="al_get_new_display_option"
><a href="#TOC"
  >al_get_new_display_option</a
  ></h2
><pre
><code
  >int al_get_new_display_option(int option, int *importance)
</code
  ></pre
><p
>Retrieve an extra display setting which was previously set with <a href="display.html#al_set_new_display_option"
  >al_set_new_display_option</a
  >.</p
><h2 id="al_reset_new_display_options"
><a href="#TOC"
  >al_reset_new_display_options</a
  ></h2
><pre
><code
  >void al_reset_new_display_options(void)
</code
  ></pre
><p
>This undoes any previous call to <a href="display.html#al_set_new_display_option"
  >al_set_new_display_option</a
  > on the calling thread.</p
><h2 id="al_set_new_display_flags"
><a href="#TOC"
  >al_set_new_display_flags</a
  ></h2
><pre
><code
  >void al_set_new_display_flags(int flags)
</code
  ></pre
><p
>Sets various flags to be used when creating new displays on the calling thread. flags is a bitfield containing any reasonable combination of the following:</p
><dl
><dt
  >ALLEGRO_WINDOWED</dt
  ><dd
  ><p
    >Prefer a windowed mode.</p
    ><p
    >Under multi-head X (not XRandR/TwinView), the use of more than one adapter is impossible due to bugs in X and glX. <a href="display.html#al_create_display"
      >al_create_display</a
      > will fail if more than one adapter is attempted to be used.</p
    ></dd
  ><dt
  >ALLEGRO_FULLSCREEN</dt
  ><dd
  ><p
    >Prefer a fullscreen mode.</p
    ><p
    >Under X the use of more than one FULLSCREEN display when using multi-head X, or true Xinerama is not possible due to bugs in X and glX, display creation will fail if more than one adapter is attempted to be used.</p
    ></dd
  ><dt
  >ALLEGRO_FULLSCREEN_WINDOW</dt
  ><dd
  ><p
    >Make the window span the entire screen. Unlike ALLEGRO_FULLSCREEN this will never attempt to modify the screen resolution. Instead the pixel dimensions of the created display will be the same as the desktop.</p
    ><p
    >The passed width and height are only used if the window is switched out of fullscreen mode later but will be ignored initially.</p
    ><p
    >Under Windows and X11 a fullscreen display created with this flag will behave differently from one created with the ALLEGRO_FULLSCREEN flag - even if the ALLEGRO_FULLSCREEN display is passed the desktop dimensions. The exact difference is platform dependent, but some things which may be different is how alt-tab works, how fast you can toggle between fullscreen/windowed mode or how additional monitors behave while your display is in fullscreen mode.</p
    ><p
    >Additionally under X, the use of more than one adapter in multi-head mode or with true Xinerama enabled is impossible due to bugs in X/glX, creation will fail if more than one adapter is attempted to be used.</p
    ></dd
  ><dt
  >ALLEGRO_RESIZABLE</dt
  ><dd
  ><p
    >The display is resizable (only applicable if combined with ALLEGRO_WINDOWED).</p
    ></dd
  ><dt
  >ALLEGRO_OPENGL</dt
  ><dd
  ><p
    >Require the driver to provide an initialized OpenGL context after returning successfully.</p
    ></dd
  ><dt
  >ALLEGRO_OPENGL_3_0</dt
  ><dd
  ><p
    >Require the driver to provide an initialized OpenGL context compatible with OpenGL version 3.0.</p
    ></dd
  ><dt
  >ALLEGRO_OPENGL_FORWARD_COMPATIBLE</dt
  ><dd
  ><p
    >If this flag is set, the OpenGL context created with ALLEGRO_OPENGL_3_0 will be forward compatible <em
      >only</em
      >, meaning that all of the OpenGL API declared deprecated in OpenGL 3.0 will not be supported. Currently, a display created with this flag will <em
      >not</em
      > be compatible with Allegro drawing routines; the display option ALLEGRO_COMPATIBLE_DISPLAY will be set to false.</p
    ></dd
  ><dt
  >ALLEGRO_DIRECT3D</dt
  ><dd
  ><p
    >Require the driver to do rendering with Direct3D and provide a Direct3D device.</p
    ></dd
  ><dt
  >ALLEGRO_NOFRAME</dt
  ><dd
  ><p
    >Try to create a window without a frame (i.e. no border or titlebar). This usualy does nothing for fullscreen modes, and even in windowed moded it depends on the underlying platform whether it is supported or not.</p
    ></dd
  ><dt
  >ALLEGRO_GENERATE_EXPOSE_EVENTS</dt
  ><dd
  ><p
    >Let the display generate expose events.</p
    ></dd
  ></dl
><p
>0 can be used for default values.</p
><p
>See also: <a href="display.html#al_set_new_display_option"
  >al_set_new_display_option</a
  >, <a href="display.html#al_get_display_option"
  >al_get_display_option</a
  ></p
><h2 id="al_set_new_display_refresh_rate"
><a href="#TOC"
  >al_set_new_display_refresh_rate</a
  ></h2
><pre
><code
  >void al_set_new_display_refresh_rate(int refresh_rate)
</code
  ></pre
><p
>Sets the refresh rate to use when creating new displays on the calling thread. If the refresh rate is not available, <a href="display.html#al_create_display"
  >al_create_display</a
  > will fail. A list of modes with refresh rates can be found with <a href="display.html#al_get_num_display_modes"
  >al_get_num_display_modes</a
  > and <a href="display.html#al_get_display_mode"
  >al_get_display_mode</a
  >.</p
><p
>The default setting is zero (don't care).</p
><p
>See also: <a href="display.html#al_get_new_display_refresh_rate"
  >al_get_new_display_refresh_rate</a
  ></p
><h2 id="al_set_new_window_position"
><a href="#TOC"
  >al_set_new_window_position</a
  ></h2
><pre
><code
  >void al_set_new_window_position(int x, int y)
</code
  ></pre
><p
>Sets where the top left pixel of the client area of newly created windows (non-fullscreen) will be on screen, for displays created by the calling thread. Negative values allowed on some multihead systems.</p
><p
>To reset to the default behaviour, pass (INT_MAX, INT_MAX).</p
><p
>See also: <a href="display.html#al_get_new_window_position"
  >al_get_new_window_position</a
  ></p
><h1 id="display-operations"
><a href="#TOC"
  >Display operations</a
  ></h1
><h2 id="al_acknowledge_resize"
><a href="#TOC"
  >al_acknowledge_resize</a
  ></h2
><pre
><code
  >bool al_acknowledge_resize(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>When the user receives a resize event from a resizable display, if they wish the display to be resized they must call this function to let the graphics driver know that it can now resize the display. Returns true on success.</p
><p
>Adjusts the clipping rectangle to the full size of the backbuffer.</p
><p
>Note that a resize event may be outdated by the time you acknowledge it; there could be further resize events generated in the meantime.</p
><p
>See also: <a href="display.html#al_resize_display"
  >al_resize_display</a
  >, <a href="events.html#allegro_event"
  >ALLEGRO_EVENT</a
  ></p
><h2 id="al_flip_display"
><a href="#TOC"
  >al_flip_display</a
  ></h2
><pre
><code
  >void al_flip_display(void)
</code
  ></pre
><p
>Copies or updates the front and back buffers so that what has been drawn previously on the currently selected display becomes visible on screen. Pointers to the special back and front buffer bitmaps remain valid and retain their semantics as back and front buffers respectively, although their contents may have changed.</p
><p
>Several display options change how this function behaves:</p
><p
>With ALLEGRO_SINGLE_BUFFER, no flipping is done. You still have to call this function to display graphics, depending on how the used graphics system works.</p
><p
>The ALLEGRO_SWAP_METHOD option may have additional information about what kind of operation is used internally to flip the front and back buffers.</p
><p
>If ALLEGRO_VSYNC is 1, this function will force waiting for vsync. If ALLEGRO_VSYNC is 2, this function will not wait for vsync. With many drivers the vsync behavior is controlled by the user and not the application, and ALLEGRO_VSYNC will not be set; in this case <a href="display.html#al_flip_display"
  >al_flip_display</a
  > will wait for vsync depending on the settings set in the system's graphics preferences.</p
><p
>See also: <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  >, <a href="display.html#al_set_new_display_option"
  >al_set_new_display_option</a
  ></p
><h2 id="al_get_backbuffer"
><a href="#TOC"
  >al_get_backbuffer</a
  ></h2
><pre
><code
  >ALLEGRO_BITMAP *al_get_backbuffer(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Return a special bitmap representing the back-buffer of the display.</p
><p
>Care should be taken when using the backbuffer bitmap (and its sub-bitmaps) as the source bitmap (e.g as the bitmap argument to <a href="graphics.html#al_draw_bitmap"
  >al_draw_bitmap</a
  >). Only untransformed operations are hardware accelerated. This consists of <a href="graphics.html#al_draw_bitmap"
  >al_draw_bitmap</a
  > and <a href="graphics.html#al_draw_bitmap_region"
  >al_draw_bitmap_region</a
  > when the current transformation is the identity. If the tranformation is not the identity, or some other drawing operation is used, the call will be routed through the memory bitmap routines, which are slow. If you need those operations to be accelerated, then first copy a region of the backbuffer into a temporary bitmap (via the <a href="graphics.html#al_draw_bitmap"
  >al_draw_bitmap</a
  > and <a href="graphics.html#al_draw_bitmap_region"
  >al_draw_bitmap_region</a
  >), and then use that temporary bitmap as the source bitmap.</p
><h2 id="al_get_display_flags"
><a href="#TOC"
  >al_get_display_flags</a
  ></h2
><pre
><code
  >int al_get_display_flags(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Gets the flags of the display.</p
><p
>In addition to the flags set for the display at creation time with <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  > it can also have the ALLEGRO_MINIMIZED flag set, indicating that the window is currently minimized. This flag is very platform-dependent as even a minimized application may still render a preview version so normally you should not care whether it is minimized or not.</p
><p
>See also: <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  ></p
><h2 id="al_get_display_format"
><a href="#TOC"
  >al_get_display_format</a
  ></h2
><pre
><code
  >int al_get_display_format(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Gets the pixel format of the display.</p
><p
>See also: <a href="graphics.html#allegro_pixel_format"
  >ALLEGRO_PIXEL_FORMAT</a
  ></p
><h2 id="al_get_display_height"
><a href="#TOC"
  >al_get_display_height</a
  ></h2
><pre
><code
  >int al_get_display_height(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Gets the height of the display. This is like SCREEN_H in Allegro 4.x.</p
><p
>See also: <a href="display.html#al_get_display_width"
  >al_get_display_width</a
  ></p
><h2 id="al_get_display_refresh_rate"
><a href="#TOC"
  >al_get_display_refresh_rate</a
  ></h2
><pre
><code
  >int al_get_display_refresh_rate(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Gets the refresh rate of the display.</p
><p
>See also: <a href="display.html#al_set_new_display_refresh_rate"
  >al_set_new_display_refresh_rate</a
  ></p
><h2 id="al_get_display_width"
><a href="#TOC"
  >al_get_display_width</a
  ></h2
><pre
><code
  >int al_get_display_width(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Gets the width of the display. This is like SCREEN_W in Allegro 4.x.</p
><p
>See also: <a href="display.html#al_get_display_height"
  >al_get_display_height</a
  ></p
><h2 id="al_get_window_position"
><a href="#TOC"
  >al_get_window_position</a
  ></h2
><pre
><code
  >void al_get_window_position(ALLEGRO_DISPLAY *display, int *x, int *y)
</code
  ></pre
><p
>Gets the position of a non-fullscreen display.</p
><p
>See also: <a href="display.html#al_set_window_position"
  >al_set_window_position</a
  ></p
><h2 id="al_inhibit_screensaver"
><a href="#TOC"
  >al_inhibit_screensaver</a
  ></h2
><pre
><code
  >bool al_inhibit_screensaver(bool inhibit)
</code
  ></pre
><p
>This function allows the user to stop the system screensaver from starting up if true is passed, or resets the system back to the default state (the state at program start) if false is passed. It returns true if the state was set successfully, otherwise false.</p
><h2 id="al_resize_display"
><a href="#TOC"
  >al_resize_display</a
  ></h2
><pre
><code
  >bool al_resize_display(ALLEGRO_DISPLAY *display, int width, int height)
</code
  ></pre
><p
>Resize the display. Returns true on success, or false on error. This works on both fullscreen and windowed displays, regardless of the ALLEGRO_RESIZABLE flag.</p
><p
>Adjusts the clipping rectangle to the full size of the backbuffer.</p
><p
>See also: <a href="display.html#al_acknowledge_resize"
  >al_acknowledge_resize</a
  ></p
><h2 id="al_set_display_icon"
><a href="#TOC"
  >al_set_display_icon</a
  ></h2
><pre
><code
  >void al_set_display_icon(ALLEGRO_DISPLAY *display, ALLEGRO_BITMAP *icon)
</code
  ></pre
><p
>Changes the icon associated with the display (window).</p
><blockquote
><p
  ><em
    >Note:</em
    > If the underlying OS can not use an icon with the size of the provided bitmap, it will be scaled.</p
  ></blockquote
><p
>See also: <a href="display.html#al_set_window_title"
  >al_set_window_title</a
  ></p
><h2 id="al_get_display_option"
><a href="#TOC"
  >al_get_display_option</a
  ></h2
><pre
><code
  >int al_get_display_option(ALLEGRO_DISPLAY *display, int option)
</code
  ></pre
><p
>Return an extra display setting of the display.</p
><p
>See also: <a href="display.html#al_set_new_display_option"
  >al_set_new_display_option</a
  ></p
><h2 id="al_set_window_position"
><a href="#TOC"
  >al_set_window_position</a
  ></h2
><pre
><code
  >void al_set_window_position(ALLEGRO_DISPLAY *display, int x, int y)
</code
  ></pre
><p
>Sets the position on screen of a non-fullscreen display.</p
><p
>See also: <a href="display.html#al_get_window_position"
  >al_get_window_position</a
  ></p
><h2 id="al_set_window_title"
><a href="#TOC"
  >al_set_window_title</a
  ></h2
><pre
><code
  >void al_set_window_title(ALLEGRO_DISPLAY *display, const char *title)
</code
  ></pre
><p
>Set the title on a display.</p
><p
>See also: <a href="display.html#al_set_display_icon"
  >al_set_display_icon</a
  ></p
><h2 id="al_toggle_display_flag"
><a href="#TOC"
  >al_toggle_display_flag</a
  ></h2
><pre
><code
  >bool al_toggle_display_flag(ALLEGRO_DISPLAY *display, int flag, bool onoff)
</code
  ></pre
><p
>Enable or disable one of the display flags. The flags are the same as for <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  >. The only flags that can be changed after creation are:</p
><ul
><li
  >ALLEGRO_FULLSCREEN_WINDOW</li
  ><li
  >ALLEGRO_NOFRAME</li
  ></ul
><p
>Returns true if the driver supports toggling the specified flag else false. You can use <a href="display.html#al_get_display_flags"
  >al_get_display_flags</a
  > to query whether the given display property actually changed.</p
><p
>See also: <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  >, <a href="display.html#al_get_display_flags"
  >al_get_display_flags</a
  ></p
><h2 id="al_update_display_region"
><a href="#TOC"
  >al_update_display_region</a
  ></h2
><pre
><code
  >void al_update_display_region(int x, int y, int width, int height)
</code
  ></pre
><p
>Does the same as <a href="display.html#al_flip_display"
  >al_flip_display</a
  >, but tries to update only the specified region. With many drivers this is not possible, but for some it can improve performance.</p
><p
>The ALLEGRO_UPDATE_DISPLAY_REGION option (see <a href="display.html#al_get_display_option"
  >al_get_display_option</a
  >) will specify the behavior of this function in the display.</p
><p
>See also: <a href="display.html#al_flip_display"
  >al_flip_display</a
  >, <a href="display.html#al_get_display_option"
  >al_get_display_option</a
  ></p
><h2 id="al_wait_for_vsync"
><a href="#TOC"
  >al_wait_for_vsync</a
  ></h2
><pre
><code
  >bool al_wait_for_vsync(void)
</code
  ></pre
><p
>Wait for the beginning of a vertical retrace. Some driver/card/monitor combinations may not be capable of this.</p
><p
>Note how <a href="display.html#al_flip_display"
  >al_flip_display</a
  > usually already waits for the vertical retrace, so unless you are doing something special, there is no reason to call this function.</p
><p
>Returns false if not possible, true if successful.</p
><p
>See also: <a href="display.html#al_flip_display"
  >al_flip_display</a
  ></p
><h2 id="al_get_display_event_source"
><a href="#TOC"
  >al_get_display_event_source</a
  ></h2
><pre
><code
  >ALLEGRO_EVENT_SOURCE *al_get_display_event_source(ALLEGRO_DISPLAY *display)
</code
  ></pre
><p
>Retrieve the associated event source.</p
><h1 id="fullscreen-display-modes"
><a href="#TOC"
  >Fullscreen display modes</a
  ></h1
><h2 id="allegro_display_mode"
><a href="#TOC"
  >ALLEGRO_DISPLAY_MODE</a
  ></h2
><pre
><code
  >typedef struct ALLEGRO_DISPLAY_MODE
</code
  ></pre
><p
>Used for display mode queries. Contains information about a supported fullscreen display mode.</p
><pre
><code
  >typedef struct ALLEGRO_DISPLAY_MODE {
   int width;          // Screen width
   int height;         // Screen height
   int format;         // The pixel format of the mode
   int refresh_rate;   // The refresh rate of the mode
} ALLEGRO_DISPLAY_MODE;
</code
  ></pre
><p
>See also: <a href="display.html#al_get_display_mode"
  >al_get_display_mode</a
  ></p
><h2 id="al_get_display_mode"
><a href="#TOC"
  >al_get_display_mode</a
  ></h2
><pre
><code
  >ALLEGRO_DISPLAY_MODE *al_get_display_mode(int index, ALLEGRO_DISPLAY_MODE *mode)
</code
  ></pre
><p
>Retrieves a display mode. Display parameters should not be changed between a call of <a href="display.html#al_get_num_display_modes"
  >al_get_num_display_modes</a
  > and <a href="display.html#al_get_display_mode"
  >al_get_display_mode</a
  >. index must be between 0 and the number returned from al_get_num_display_modes-1. mode must be an allocated ALLEGRO_DISPLAY_MODE structure. This function will return NULL on failure, and the mode parameter that was passed in on success.</p
><p
>See also: <a href="display.html#allegro_display_mode"
  >ALLEGRO_DISPLAY_MODE</a
  >, <a href="display.html#al_get_num_display_modes"
  >al_get_num_display_modes</a
  ></p
><h2 id="al_get_num_display_modes"
><a href="#TOC"
  >al_get_num_display_modes</a
  ></h2
><pre
><code
  >int al_get_num_display_modes(void)
</code
  ></pre
><p
>Get the number of available fullscreen display modes for the current set of display parameters. This will use the values set with <a href="display.html#al_set_new_display_refresh_rate"
  >al_set_new_display_refresh_rate</a
  >, and <a href="display.html#al_set_new_display_flags"
  >al_set_new_display_flags</a
  > to find the number of modes that match. Settings the new display parameters to zero will give a list of all modes for the default driver.</p
><p
>See also: <a href="display.html#al_get_display_mode"
  >al_get_display_mode</a
  ></p
><h1 id="monitors"
><a href="#TOC"
  >Monitors</a
  ></h1
><h2 id="allegro_monitor_info"
><a href="#TOC"
  >ALLEGRO_MONITOR_INFO</a
  ></h2
><pre
><code
  >typedef struct ALLEGRO_MONITOR_INFO
</code
  ></pre
><p
>Describes a monitors size and position relative to other monitors. x1, y1 will be 0, 0 on the primary display. Other monitors can have negative values if they are to the left or above the primary display.</p
><pre
><code
  >typedef struct ALLEGRO_MONITOR_INFO
{
   int x1;
   int y1;
   int x2;
   int y2;
} ALLEGRO_MONITOR_INFO;
</code
  ></pre
><p
>See also: <a href="display.html#al_get_monitor_info"
  >al_get_monitor_info</a
  ></p
><h2 id="al_get_new_display_adapter"
><a href="#TOC"
  >al_get_new_display_adapter</a
  ></h2
><pre
><code
  >int al_get_new_display_adapter(void)
</code
  ></pre
><p
>Gets the video adapter index where new displays will be created by the calling thread, if previously set with <a href="display.html#al_set_new_display_adapter"
  >al_set_new_display_adapter</a
  >. Otherwise returns <code
  >ALLEGRO_DEFAULT_DISPLAY_ADAPTER</code
  >.</p
><p
>See also: <a href="display.html#al_set_new_display_adapter"
  >al_set_new_display_adapter</a
  ></p
><h2 id="al_set_new_display_adapter"
><a href="#TOC"
  >al_set_new_display_adapter</a
  ></h2
><pre
><code
  >void al_set_new_display_adapter(int adapter)
</code
  ></pre
><p
>Sets the adapter to use for new displays created by the calling thread. The adapter has a monitor attached to it. Information about the monitor can be gotten using <a href="display.html#al_get_num_video_adapters"
  >al_get_num_video_adapters</a
  > and <a href="display.html#al_get_monitor_info"
  >al_get_monitor_info</a
  >.</p
><p
>To return to the default behaviour, pass <code
  >ALLEGRO_DEFAULT_DISPLAY_ADAPTER</code
  >.</p
><p
>See also: <a href="display.html#al_get_num_video_adapters"
  >al_get_num_video_adapters</a
  >, <a href="display.html#al_get_monitor_info"
  >al_get_monitor_info</a
  ></p
><h2 id="al_get_monitor_info"
><a href="#TOC"
  >al_get_monitor_info</a
  ></h2
><pre
><code
  >bool al_get_monitor_info(int adapter, ALLEGRO_MONITOR_INFO *info)
</code
  ></pre
><p
>Get information about a monitor's position on the desktop. adapter is a number from 0 to al_get_num_video_adapters()-1.</p
><p
>Returns true on success, false on failure.</p
><p
>See also: <a href="display.html#allegro_monitor_info"
  >ALLEGRO_MONITOR_INFO</a
  >, <a href="display.html#al_get_num_video_adapters"
  >al_get_num_video_adapters</a
  ></p
><h2 id="al_get_num_video_adapters"
><a href="#TOC"
  >al_get_num_video_adapters</a
  ></h2
><pre
><code
  >int al_get_num_video_adapters(void)
</code
  ></pre
><p
>Get the number of video &quot;adapters&quot; attached to the computer. Each video card attached to the computer counts as one or more adapters. An adapter is thus really a video port that can have a monitor connected to it.</p
><p
>See also: <a href="display.html#al_get_monitor_info"
  >al_get_monitor_info</a
  ></p
>
<p class="timestamp">
Allegro version 5.0.3
 - Last updated: 2011-05-22 02:32:04 UTC
</p>
</div>

</body>
</html>