Environment Variables
Many of the environment variables will only be usable if the applications use the high
level initialization API, via :
- Using the CBasicAppObject class as the base application
class.
- Without using the above class, but initializing using these functions :
- CAudioEnv::AutoDetect() and CAudioEnv::DoQuickInit()
- CMidiPlayer::AutoDetect() and CMidiPlayer::DoQuickInit()
- CVideoEnv::DoQuickInit()
It is recommended that VortexGE applications always use the high level initialization
API instead of using the low level counterparts. See the topic "The High Level Way"
at the tutorial page for some examples.
Configuring the Video System
- Set the environment variable VGE_VIDEO_CUSTOM_8BPP_PALETTE
to use custom color palette for 8 bpp display mode. Valid values are (not case sensitive) :
It is recommended to just use the system default palette (colormap) tough.
- Under X Window system, set the environment variable DISPLAY
to select the display name to be used when VortexGE tries to connect to the X server. Note
that unless the application is not working well, it is recommended not to change the
default value of the environment variable in the system.
Configuring the Audio System
- Set the environment variable VGE_AUDIO_SYSTEM
to select the preferred audio system. Valid values are (not case sensitive) :
It is recommended to just use the system default palette (colormap) tough.
- Set the environment variable VGE_AUDIO_DEVICE
to select the preferred audio device to be used. Valid values are depend on the audio
system used, for examples (case sensitive) :
- For ALSA audio system :
- default
- hw:0,0
- hw:0,1
- hw:1,0
- plughw:0,0
- plughw:0,1
- plughw:1,0
- etc.
- For OSS audio system :
- /dev/dsp
- /dev/dsp0
- /dev/dsp1
- /dev/sound/dsp
- /dev/sound/dsp0
- /dev/sound/dsp1
- /dev/audio
- /dev/audio0
- /dev/audio1
- etc.
- For dummy / null audio system :
Configuring the MIDI System
- Set the environment variable VGE_MIDI_SYSTEM
to select the preferred MIDI system. Valid values are (not case sensitive) :
- timidity / libtimidity
- dummy / null
- If using libTiMidity, set the environment variable
VGE_TIMIDITY_CFG_FILE to tell VortexGE about the location
of the "timidity.cfg" file (if the file is located in a non
standard place). Remember that directory and file names are case sensitive.
Configuring the Message Catalog
- Set the environment variable VGE_MESSAGE_CATALOG_PATH
to tell VortexGE where the location of the library's internal message catalog files
(*.cat) are located. The internal message catalog is used for internationalizing some
of the library's internal messages (currently only some dialog messages can be
internationalized). If the environment variable is not set, the library will search its
internal catalog files from :
-
"/path_to_the_library_installation_directory/lib/libVGE.messages.cat"
(hardcoded by the configuration script).
It is not recommended to use the environment variable unless
you have installed VortexGE to a different directory than was specified in the
configuration process.
User applications should use different directories and environment
variables for their message catalog files (rather than adding new entries in the library's
internal message catalog files). However, users can append the contents of their message
catalog files to the CBasicAppObjects's message catalog class instance (see the API
documentation for more details).
- These environment variables will tell VortexGE what catalog file
to be loaded from a catalog directory :
- VGE_LOCALE
- LC_MESSAGES
- LC_ALL
- LANGUAGE
- LANG
Note that those variables are used based on priority, for example :
- If VGE_LOCALE is set (even it contains invalid locale
name) then the other 4 variables will be ignored.
- If LC_ALL is set and the other 4 are not set then the
catalog for the language defined in LC_ALL will be loaded.
But later, if the user also set LC_MESSAGES, it will takes
the priority.
So it is clear that VGE_LOCALE has the highest priority and
LANG has the lowest priority. Also the settings in those
environment variables can be overridden by explicitly telling VortexGE what locale
to be used when loading catalog :
- CMessageCatalog::CMessageCatalog(const
string &pathToMessageCatalog, const char *messagesLocale)
- CMessageCatalog::LoadCatalog(const
string &pathToMessageCatalog, const char *messagesLocale)
Other Environment Variables
Example (using bash) :
# export VGE_VIDEO_CUSTOM_8BPP_PALETTE="yes"
# export VGE_AUDIO_SYSTEM="alsa"
# export VGE_AUDIO_DEVICE="plughw:1,2"
# export VGE_MIDI_SYSTEM="timidity"
# export VGE_TIMIDITY_CFG_FILE="/opt/timidity/timidity.cfg"
# export VGE_LOCALE="id_ID"