Update of /project/gamelib/cvsroot/source/doc In directory clnet:/tmp/cvs-serv968/doc
Added Files: stick.html Log Message: IM Initial check-in
--- NEW FILE: stick.html --- <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Gamelib - games-3d library</title> <link rel="stylesheet" type="text/css" href="../style.css"/> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> </head> <body> <div class="header"> <h1>Gamelib</h1> <h2>The joystick library</h2> </div>
<h3>Introduction</h3>
<p>Having the use of a joystick enhances the sensation of presence in a game. Under linux, the available joystick API is based around periodic reading of events from a device driver file (usually /dev/js<i>X</i> or /dev/input/js<i>X</i>).</p>
<p>Gamelib now offers an interface to handle joysticks on the linux platform (code for joystick handling on other platforms is welcome). The joystick is somewhat abstracted from the raw data that the device driver offers.</p>
<h3>API</h3>
<p>The interface is centred around a JOYSTICK object (created by calling MAKE-STICK with a suitable device name as argument). To read an event from the device driver, call UPDATE-STICK with the joystick object as argument.</p>
<p>Under SBCL (with thread support) there is a "continous poll" support (simply call CONTINOUS-POLL with the joystick object as argument, to terminate the polling thread, call TERMINATE-POLL with the object as argument). All relevant locking is done, keyed on if a joystick is polled or not</p>
<p>There are two arrays that are of interest in a joystick object <i>js</i>. The first is the analog axes, (axes <i>js</i>) and the second is the buttons (buttons <i>js</i>). The library currently supports up to 8 analog axes and up to 24 buttons (and will most likely crash in amusing ways, should these limits be too strict).</p>