2006-01-28 00:41:16 +00:00
|
|
|
profileName=opengl
|
|
|
|
profileDir=/nix/var/nix/profiles
|
|
|
|
profile=$profileDir/$profileName
|
|
|
|
|
|
|
|
if test -z "$OPENGL_DRIVER"; then
|
|
|
|
if test -d "$profile/lib"; then
|
|
|
|
OPENGL_DRIVER=$profile
|
|
|
|
fi
|
2007-02-27 00:49:47 +00:00
|
|
|
# OpenGL driver for current X server on NixOS.
|
2007-06-09 20:46:27 +01:00
|
|
|
if test -d /var/run/opengl-driver; then
|
|
|
|
OPENGL_DRIVER=/var/run/opengl-driver
|
2007-02-27 00:49:47 +00:00
|
|
|
fi
|
2006-01-28 00:41:16 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$OPENGL_DRIVER"; then
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
======================================================================
|
|
|
|
This program uses OpenGL for 3D graphics. For best performance, you
|
|
|
|
should use a hardware-accelerated implementation of OpenGL. Since you
|
|
|
|
have not enabled one, a software implementation (Mesa) will be used.
|
|
|
|
This will probably be quite slow.
|
|
|
|
|
|
|
|
This program will look for a hardware-accelerated implementation of
|
|
|
|
OpenGL in the "$profileName" profile of your Nix installation. For
|
2006-01-28 01:13:31 +00:00
|
|
|
instance, to enable the (hopefully) accelerated driver provided by
|
|
|
|
your (non-NixOS) Linux distribution, try
|
2006-01-28 00:41:16 +00:00
|
|
|
|
2006-01-28 01:13:31 +00:00
|
|
|
$ nix-env -p $profile -i xorg-sys-opengl
|
2006-01-28 00:41:16 +00:00
|
|
|
|
|
|
|
Alternatively, you can set the OPENGL_DRIVER environment variable to
|
|
|
|
point at the package containing the OpenGL implementation.
|
|
|
|
======================================================================
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
OPENGL_DRIVER=$mesa
|
|
|
|
fi
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}$OPENGL_DRIVER/lib
|
|
|
|
|
|
|
|
hook="$OPENGL_DRIVER/nix-support/opengl-hook"
|
|
|
|
if test -e "$hook"; then
|
|
|
|
source "$hook"
|
|
|
|
fi
|