Initialise Xiqual and all SDL subsystems.
Initialise Xiqual and all SDL subsystems. The tags supplied allow you to selectively initialise some SDL subsystems, create a mousepointer from an SDL_image supported file and more.To intialise all supported SDL libraries and create the xiglob structure, with an 800x600x16 display:
xi_init(XI_WIDTH, 800,
XI_HEIGHT, 600,
XI_DEPTH, 16, TAG_END);This creates a mouse cursor, and tells Xiqual to also handle the cursor, in addition to opening a typical display:
xi_init(XI_WIDTH, 800,
XI_HEIGHT, 600,
XI_DEPTH, 16,
XI_CURSORFILE, "cursor.png",
TAG_END);Supported tags
Xiqual settings and hooks
- XI_MAINHOOK
A pointer to a function to be called at each input poll. See xisetup.h/xi_main() for information on the arguments passed.- XI_PREFS
Load this configuration file. This is currently only for convenience, but Xiqual may start looking for a section of its own for various settings in the future (type of SDL audio/video drivers to use etc.).It will first look for $HOME/.xiqual/
, then it will look in the current directory. Win32 will just look in the current directory. If this file isn't found, Xiqual attempts to load $HOME/.xiqual/xiqualrc, followed by xiqualrc in the current directory. Win32 once again gets the short end of the path.
SDL settings
- XI_WIDTH, XI_HEIGHT
Screensize. Will be emulated if using an odd resolution, or if it's not available according to the XF86Config (for example, 320x240 is usually not defined as available for 16-bit resolutions). This WILL LOOK CRUDDY.- XI_DEPTH
Bitplane depth (note that SDL may emulate this).- XI_SDLFLAGS
If you need to initialise threading, or only a few SDL subsystems, pass the replacement flags here. These will be used instead of the defaults, which is SDL_INIT_EVERYTHING.- XI_SCRFLAGS
Xiqual will default to opening the screen with flags SDL_SWSURFACE | SDL_DOUBLEBUF, so pass a different set of flags here if that isn't what you want. Note that many other Xiqual functions also rely on software buffers for blits, and these can't be changed (yet). NVidia cards blit faster on software, too.- XI_CURSOR
You may pass a pointer to an xiview with this tag. Xiqual frees this structure on exit.- XI_CURSORFILE
This tag is for those who prefer to create a mouse cursor image with more colours. A view is created, and will be freed on exit, like XI_CURSOR.- XI_CURSORKEY
Pass a colourkey (as returned from SDL_MapRGB()) here if you also specified a filename to load a cursor from. If specifying a cursor directly, that view's key will be used.- XI_CURSOR_HOTX, XI_CURSOR_HOTY
This is the location of the "hotspot", the point on the cursor image that is considered the active (selecting) part. The image will be drawn at mouse coordinates minus these coordinates.SDL_mixer settings
- XI_MIXCHAN
Maximum number of total mixing channels. Defaults to eight.- XI_AUDIORATE
Bitrate (frequency) to use for mixed audio, if SDL_mixer is available. Defaults to 22050Hz.- XI_AUDIOCHAN
Defines type of audio for music - 1 for mono, 2 for stereo. See XI_MAXCHAN, if you're confused.- XI_AUDIOBUFSIZE
Size of audio buffers - too small or too big may cause stuttering or unexpected pauses on older systems and bad sound hardware. Note: Must be a multiple of 16.- XI_AUDIO_FMT
Audio format to use for audio mixing. May be one of:
- AUDIO_U8
Unsigned 8-bit.- AUDIO_S8
Signed 8-bit.- AUDIO_U16LSB
16-bit unsigned (Intel format).- AUDIO_S16LSB
16-bit signed (Intel format). This is the default for WAV.- AUDIO_U16, AUDIO_S16
Shorthand for the two Intel formats.- AUDIO_U16MSB
Big-endian unsigned 16-bit.- AUDIO_S16MSB
Big-endian signed 16-bit.- AUDIO_U16SYS
16-bit audio of whatever is the native byte-order.- AUDIO_S16SYS
16-bit signed audio of native byte-order.SDL TTF settings
- XI_TTF
Set data to non-zero to enable SDL_ttf initialisation.LUI settings
- XI_LUI
Set data to non-zero to enable LUI initialisation.