#!/bin/sh
scriptpath=$(readlink -f "$0")
scriptdir=$(dirname "$scriptpath")

for arg; do
    if [ "$arg" = "--help" ]; then
        printf "Usage: %s [<ags options>]\n\n" "$(basename "$0")"
        break
    fi
done

## Old versions of Mesa can hang when using DRI3
## https://bugs.freedesktop.org/show_bug.cgi?id=106404
export LIBGL_DRI3_DISABLE=true

if [ "$(uname -m)" = "x86_64" ]; then
    "$scriptdir/data/ags64" "$@" "$scriptdir/data/"
else
    "$scriptdir/data/ags32" "$@" "$scriptdir/data/"
fi
