old-www/HOWTO/Linux-Gamers-HOWTO/x276.html

472 lines
9.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>XFree86 and You</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="The Linux Gamers' HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Libraries"
HREF="x130.html"><LINK
REL="NEXT"
TITLE="Various Topics"
HREF="x343.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux Gamers' HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x130.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x343.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN276"
></A
>4. XFree86 and You</H1
><P
>If you're going to game under X, it's crucial that you know a bit about X. The "X Window
User HOWTO", and especially "man XF86Config" are <EM
>required</EM
> reading. Don't
short change yourself; read them. They have an extremely high "information to space" ratio. Many
problems can be fixed easily if you know your way around <TT
CLASS="FILENAME"
>XF86Config</TT
> (or
<TT
CLASS="FILENAME"
>XF86Config-4</TT
>).</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN282"
></A
>4.1. Getting information about your X system</H2
><P
>Whether you're trying to diagnose an X problem or requesting help from a mailing list or
Usenet newsgroup, you'll want to have as much information available as possible. These are a
set of tools you can use to obtain that information.</P
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN285"
></A
>4.1.1. Probeonly</H3
><P
>One of the best diagnostic tools and sources of information about your X system is
<B
CLASS="COMMAND"
>probeonly</B
> output. To use it, kill X if it's already running and from a
console, type:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> X -probeonly 2&#62; X.out
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Yes, that's a single dash; so much for standards. The output of X goes to stderr,
so we have to redirect stderr with "2&#62;" to a file named <TT
CLASS="FILENAME"
>X.out</TT
>. This
file will have almost everything there is to know about your X system. It's crucial that
you know the difference between the various markers you'll see in probeonly output:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> (--) probed (**) from config file (==) default setting
(++) from command line (!!) notice (II) informational
(WW) warning (EE) error (??) unknown.
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Here's an example of some information I gleaned from my output:</P
><P
>I'm running at 16 bpp color:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> (**) TDFX(0): Depth 16, (--) framebuffer bpp 16
</PRE
></FONT
></TD
></TR
></TABLE
><P
>X has detected what my videocard chipset and videoram are:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> (--) Chipset 3dfx Voodoo5 found
(--) TDFX(0): VideoRAM: 32768 kByte Mapping 65536 kByte
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN298"
></A
>4.1.2. Getting info about your setup: xvidtune</H3
><P
><SPAN
CLASS="APPLICATION"
>xvidtune</SPAN
> is your friend when your X screen is shifted a
little bit too far to the right, or if the vertical length is too small to fit on your
monitor. However, it's a great diagnostic tool also. It'll give you:</P
><P
></P
><UL
><LI
><P
>the hsync/vsync range specified in your XF86Config file</P
></LI
><LI
><P
>the 4 horizontal and 4 vertical numbers which defines your videomode (the
1st horizontal/vertical numbers gives the screen resolution). These 8 numbers will tell you
which modeline your X uses. See the XFree86 Video Timings Howto for more information. Note
that explicit modelines are no longer necessary, since XFree 4.0.1 and up computes
modetimings automatically based on your monitor's and video card's capabilities. However,
there may be times when you'll want to play around with mode timings, like for weird
hardware or if want to tweak your display.</P
></LI
><LI
><P
>the "dot clock" your videocard is running at.</P
></LI
></UL
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN309"
></A
>4.1.3. Getting info about your setup: xwininfo</H3
><P
><B
CLASS="COMMAND"
>xwininfo</B
> tells you all sorts of information about X windows. And
actually, your "background" or "root" window is considered a window too. So when xwininfo
asks you to click on the window you want the information on, click on your background.
It'll tell you things like screen and window resolution, color depth, window gravity state
(which gives a hint to the window manager about where to place new windows), backing store
usage and more.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN313"
></A
>4.1.4. Other sources of information</H3
><P
><B
CLASS="COMMAND"
>xdpyinfo</B
> gives cool stuff, like X version and loaded extensions
(invaluable when trying to see what's missing, like GLX, DRI, XFree86-VidMode, etc.).</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN317"
></A
>4.1.5. Getting information about your 3D system</H3
><P
><B
CLASS="COMMAND"
>glxinfo</B
> gives lots of useful information about OpenGL like whether
direct rendering enabled, the currently installed versions of glx and mesa, vendor/renderer
strings, the GL library files being used and more.</P
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="NOWM"
></A
>4.2. Playing Games In X Without a Window Manager</H2
><P
>When playing a game under X, you should consider starting X without a window manager
(WM). Heavyweight WMs, like Enlightenment, or full-blown desktop environments like GNOME or
KDE, may produce a noticeable slow down. Even lightweight WMs, like twm, rob your CPU of
clock cycles (and in twm's case, even full screen games will have a frame around the window).
Running a game without a WM or DE depends on how you access X. If you usually log in to a
Virtual Console and start X with "startx" try the following: </P
><P
>Modify <TT
CLASS="FILENAME"
>~/.xinitrc</TT
>, which tells X what to run upon starting. Here
is what my .xinitrc looks like:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> #quake3 +set r_gldriver libGR.so.1
#exec ut
#lsdldoom -server 2
#exec tribes2
exec /usr/bin/enlightenment
</PRE
></FONT
></TD
></TR
></TABLE
><P
>You'll usually see a window or desktop manager being executed from this file (GNOME or
KDE). Comment out the lines containing the WM or desktop manager with a pound sign (#) and
place your game on a new line with any command line arguments you want to pass. If the game
is not located in your $PATH, give its full path name.</P
><P
>If you log directly into X using gdm, then things are a little different. These
instructions are for gdm 2.4 or greater. They *may* work with kde, but I cannot say for
certain.</P
><P
>First, check your <TT
CLASS="FILENAME"
>gdm.conf</TT
> (usually in <TT
CLASS="FILENAME"
>/etc/X11/gdm</TT
> or <TT
CLASS="FILENAME"
>/etc/gdm</TT
>)
file for a line that says begins "<TT
CLASS="LITERAL"
>SessionDesktopDir=blah</TT
>". One of the
directories listed as options should be "<TT
CLASS="FILENAME"
>/usr/share/xsessions</TT
>", and is the directory which will be used in
this example. As root, change to the "<TT
CLASS="FILENAME"
>/usr/share/xsessions</TT
>" directory and take a look at its contents.
It should contain some <TT
CLASS="FILENAME"
>.desktop</TT
> files, each corresponding to an entry
you'll see in gdm's Session menu, e.g <TT
CLASS="FILENAME"
>gnome.desktop</TT
>,
<TT
CLASS="FILENAME"
>enlightenment.destop</TT
>. This example will show you how to log in to Doom3.
Copy any of the desktop files to "<TT
CLASS="FILENAME"
>doom3.desktop</TT
>" and open the new file in
your favourite text editor. The file will be full of alternative languages, so cut out
everything you don't want and make the file look like this:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> [Desktop Entry]
Encoding=UTF-8
Name=DOOM III
Comment=iD's Doom III
#if game is not in path, remember to put the full path here
Exec=/usr/games/doom3/doom3
# no icon yet, only the top three are currently used
Icon=
Type=Application
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Save the file and log out of your window manager. At the gdm login screen, you should
now see "<TT
CLASS="LITERAL"
>DOOM III</TT
>" as an option in "Sessions". Naturally you can add a
.desktop file for each game you have installed</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x130.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x343.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Libraries</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Various Topics</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>