GFX_

Supported Windows graphic drivers.

Description

Drivers GFX_*/Windows
The Windows library supports the following card parameters for the set_gfx_mode() function:
  • GFX_TEXT
    This closes any graphics mode previously opened with set_gfx_mode.
  • GFX_AUTODETECT
    Let Allegro pick an appropriate graphics driver.
  • GFX_AUTODETECT_FULLSCREEN
    Autodetects a graphics driver, but will only use fullscreen drivers, failing if these are not available on current platform.
  • GFX_AUTODETECT_WINDOWED
    Same as above, but uses only windowed drivers.
  • GFX_SAFE
    Special driver for when you want to reliably set a graphics mode and don't really care what resolution or color depth you get. See the set_gfx_mode() documentation for details.
  • GFX_DIRECTX
    Alias for GFX_DIRECTX_ACCEL.
  • GFX_DIRECTX_ACCEL
    The regular fullscreen DirectX driver, running with hardware acceleration enabled.
  • GFX_DIRECTX_SOFT
    DirectX fullscreen driver that only uses software drawing, rather than any hardware accelerated features.
  • GFX_DIRECTX_SAFE
    Simplified fullscreen DirectX driver that doesn't support any hardware acceleration, video or system bitmaps, etc.
  • GFX_DIRECTX_WIN
    The regular windowed DirectX driver, running in color conversion mode when the color depth doesn't match that of the Windows desktop. Color conversion is much slower than direct drawing and is not supported between 15-bit and 16-bit color depths. This limitation is needed to work around that of desktop_color_depth() (see above) and allows to select the direct drawing mode in a reliable way on desktops reported as 16-bit:
    	 if (desktop_color_depth() == 16) {
    	    set_color_depth(16);
    	    if (set_gfx_mode(GFX_DIRECTX_WIN, 640, 480, 0, 0)
    		!= 0) {
    	       set_color_depth(15);
    	       if (set_gfx_mode(GFX_DIRECTX_WIN, 640, 480, 0, 0)
    		   != 0) {
    		  /* 640x480 direct drawing mode not supported */
    		  goto Error;
    	       }
    	    }
    	    /* ok, we are in direct drawing mode */
    	 }
    Note that, mainly for performance reasons, this driver requires the width of the screen to be a multiple of 4. This driver is capable of displaying a hardware cursor, but there are size restrictions. Typically, the cursor image cannot be more than 32x32 pixels.
  • GFX_DIRECTX_OVL
    The DirectX overlay driver. It uses special hardware features to run your program in a windowed mode: it doesn't work on all hardware, but performance is excellent on cards that are capable of it. It requires the color depth to be the same as that of the Windows desktop. In light of the limitation of desktop_color_depth() (see above), the reliable way of setting the overlay driver on desktops reported as 16-bit is:
    	 if (desktop_color_depth() == 16) {
    	    set_color_depth(16);
    	    if (set_gfx_mode(GFX_DIRECTX_OVL, 640, 480, 0, 0)
    		!= 0) {
    	       set_color_depth(15);
    	       if (set_gfx_mode(GFX_DIRECTX_OVL, 640, 480, 0, 0)
    		   != 0) {
    		  /* 640x480 overlay driver not supported */
    		  goto Error;
    	       }
    	    }
    	    /* ok, the 640x480 overlay driver is running */
    	 }
  • GFX_GDI
    The windowed GDI driver. It is extremely slow, but is guaranteed to work on all hardware, so it can be useful for situations where you want to run in a window and don't care about performance. Note that this driver features a hardware mouse cursor emulation in order to speed up basic mouse operations (like GUI operations).
See Also: