# Unix specifics

####
- DIGI_*/Unix
- GFX_*/Linux
- GFX_*/X
- MIDI_*/Unix

In order to locate things like the config and translation files, Allegro needs to know the path to your executable. Since there is no standard way to find that, it needs to capture a copy of your argv[] parameter, and it does this with some preprocessor macro trickery. Unfortunately it can't quite pull this off without a little bit of your help, so you will have to write END_OF_MAIN() right after your main() function. Pretty easy, really, and if you forget, you'll get a nice linker error about a missing _mangled_main function to remind you :-)

Drivers GFX_*/Linux
When running in Linux console mode, Allegro supports the following card parameters for the set_gfx_mode() function:

- GFX_TEXT
  Return to text 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. This will always fail under Linux console mode.

- 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_FBCON
  Use the framebuffer device (eg. /dev/fb0). This requires you to have framebuffer support compiled into your kernel, and correctly configured for your hardware. It is currently the only console mode driver that will work without root permissions, unless you are using a development version of SVGAlib.

- GFX_VBEAF
  Use a VBE/AF driver (vbeaf.drv), assuming that you have installed one which works under Linux (currently only two of the FreeBE/AF project drivers are capable of this: I don't know about the SciTech ones). VBE/AF requires root permissions, but is currently the only Linux driver which supports hardware accelerated graphics.

- GFX_SVGALIB
  Use the SVGAlib library for graphics output. This requires root permissions if your version of SVGAlib requires them.

- GFX_VGA
  GFX_MODEX
  Use direct hardware access to set standard VGA or mode-X resolutions, supporting the same modes as in the DOS versions of these drivers. Requires root permissions.

Drivers GFX_*/X
When running in X mode, Allegro supports the following card parameters for the set_gfx_mode() function:

- GFX_TEXT
  This closes any graphic 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_XWINDOWS
  The standard X graphics driver. This should work on any Unix system, and can operate remotely. It does not require root permissions.

- GFX_XWINDOWS_FULLSCREEN
  The same as above, but while GFX_XWINDOWS runs windowed, this one uses the XF86VidMode extension to make it run in fullscreen mode even without root permissions. You're still using the standard X protocol though, so expect the same low performances as with the windowed driver version.

- GFX_XDGA
  Use the XFree86 DGA 1.0 extension to write directly to the screen surface. DGA is normally much faster than the standard X mode, but does not produce such well behaved windowed programs, and will not work remotely. This driver requires root permissions.

- GFX_XDGA_FULLSCREEN
  Like GFX_XDGA, but also changes the screen resolution so that it will run fullscreen. This driver requires root permissions.

- GFX_XDGA2
  Use new DGA 2.0 extension provided by XFree86 4.0.x. This will work in fullscreen mode, and it will support hardware acceleration if available. This driver requires root permissions.

- GFX_XDGA2_SOFT
  The same as GFX_XDGA2, but turns off hardware acceleration support. This driver requires root permissions.

Drivers DIGI_*/Unix
The Unix sound functions support the following digital soundcards:

          DIGI_AUTODETECT      - let Allegro pick a digital sound driver
          DIGI_NONE            - no digital sound
          DIGI_OSS             - Open Sound System
          DIGI_ESD             - Enlightened Sound Daemon
          DIGI_ARTS            - aRts (Analog Real-Time Synthesizer)
          DIGI_ALSA            - ALSA sound driver

Drivers MIDI_*/Unix
The Unix sound functions support the following MIDI soundcards:

          MIDI_AUTODETECT      - let Allegro pick a MIDI sound driver
          MIDI_NONE            - no MIDI sound
          MIDI_OSS             - Open Sound System
          MIDI_DIGMID          - sample-based software wavetable player
          MIDI_ALSA            - ALSA RawMIDI driver

Back to Contents