diff --git a/README b/README new file mode 100644 index 0000000..e378a1f --- /dev/null +++ b/README @@ -0,0 +1,34 @@ +This package contains various shell scripts which are intented for use by +3D games packages. These shell scripts can be used to check if direct rendering +is available before launching an OpenGL game. This package is intended for use +by other packages and is not intended for direct end user use! + + +Currently this package only contains one script: +opengl-game-wrapper.sh + +To use this script create a link in /usr/bin gamename-wrapper[.sh] to +opengl-game-wrapper.sh, and put gamename-wrapper[.sh] in your desktop file +instead of gamename. The wrapper script will use $0 to determine gamename, +if direct rendering is available the wrapper script will execute gamename +with any parameters passed to the script, if direct rendering is not +available a userfriendly error dialog will be shown explaining that gamename +cannot run without hardware accelerated 3d, and that this is probably due to +missing Free Software support for the users card. + + +In the future I also plan to add an opengl-games-functions.sh file which can +be included by other wrapper scripts, the idea is to have a function in here +which will return true or false depending on if the current glx setup is a +setup which is known to work well. This function will have a list of +OpenGL renderer strings of known to work well drivers. This can then be used +by games which can take advantage of OpenGL, but will work without it too, +to determine wether or not to enable OpenGL support. The idea here is that +one might not want to enable OpenGL by default on SIS, VIA and other +low quality chipset / drivers. + + +Last but not least before I forget, to avoid any licensing issues I hereby +declare that all files in this package are in the Public Domain. + +Hans de Goede 22 septemper 2007. diff --git a/opengl-game-wrapper.sh b/opengl-game-wrapper.sh new file mode 100644 index 0000000..324aefd --- /dev/null +++ b/opengl-game-wrapper.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +GAME=`basename $0 | sed 's/-wrapper.*//'` + +if [ `glxinfo | grep "direct rendering: " | cut -d " " -f 3` != Yes ]; then + zenity --error --text="Your system currently is not capable of hardware \ +accelerated 3D. Therefor $GAME cannot run. + +Usually the cause of this error is that there are no Free Software drivers \ +for your graphics card, please contact your graphics card manufacturer and \ +kindly ask them to provide Free Software support for your card." + exit 1; +fi + +exec $GAME "$@" diff --git a/opengl-games-utils.spec b/opengl-games-utils.spec new file mode 100644 index 0000000..b44f921 --- /dev/null +++ b/opengl-games-utils.spec @@ -0,0 +1,51 @@ +Name: opengl-games-utils +Version: 0.1 +Release: 2%{?dist} +Summary: Utilities to check proper 3d support before launching 3d games +Group: Amusements/Games +License: Public Domain +URL: http://fedoraproject.org/wiki/SIGs/Games +Source0: opengl-game-wrapper.sh +Source1: README +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +Requires: zenity glx-utils + +%description +This package contains various shell scripts which are intented for use by +3D games packages. These shell scripts can be used to check if direct rendering +is available before launching an OpenGL game. This package is intended for use +by other packages and is not intended for direct end user use! + + +%prep +%setup -c -T +cp %{SOURCE1} . + + +%build +# nothing to build + + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir} +install -p -m 755 %{SOURCE0} $RPM_BUILD_ROOT%{_bindir} + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc README +%{_bindir}/opengl-game-wrapper.sh + + +%changelog +* Sun Sep 16 2007 Hans de Goede 0.1-2 +- Various spelling fixes thanks to Rahul Sundaram + +* Sun Sep 16 2007 Hans de Goede 0.1-1 +- Initial Fedora package