docs/html/sdljoystickopen.html
changeset 3352 6dc250ebdd80
parent 3351 8e0182c236d8
child 3353 6b14223dd5c7
     1.1 --- a/docs/html/sdljoystickopen.html	Wed Oct 07 06:11:53 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,259 +0,0 @@
     1.4 -<HTML
     1.5 -><HEAD
     1.6 -><TITLE
     1.7 ->SDL_JoystickOpen</TITLE
     1.8 -><META
     1.9 -NAME="GENERATOR"
    1.10 -CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
    1.11 -"><LINK
    1.12 -REL="HOME"
    1.13 -TITLE="SDL Library Documentation"
    1.14 -HREF="index.html"><LINK
    1.15 -REL="UP"
    1.16 -TITLE="Joystick"
    1.17 -HREF="joystick.html"><LINK
    1.18 -REL="PREVIOUS"
    1.19 -TITLE="SDL_JoystickName"
    1.20 -HREF="sdljoystickname.html"><LINK
    1.21 -REL="NEXT"
    1.22 -TITLE="SDL_JoystickOpened"
    1.23 -HREF="sdljoystickopened.html"></HEAD
    1.24 -><BODY
    1.25 -CLASS="REFENTRY"
    1.26 -BGCOLOR="#FFF8DC"
    1.27 -TEXT="#000000"
    1.28 -LINK="#0000ee"
    1.29 -VLINK="#551a8b"
    1.30 -ALINK="#ff0000"
    1.31 -><DIV
    1.32 -CLASS="NAVHEADER"
    1.33 -><TABLE
    1.34 -SUMMARY="Header navigation table"
    1.35 -WIDTH="100%"
    1.36 -BORDER="0"
    1.37 -CELLPADDING="0"
    1.38 -CELLSPACING="0"
    1.39 -><TR
    1.40 -><TH
    1.41 -COLSPAN="3"
    1.42 -ALIGN="center"
    1.43 ->SDL Library Documentation</TH
    1.44 -></TR
    1.45 -><TR
    1.46 -><TD
    1.47 -WIDTH="10%"
    1.48 -ALIGN="left"
    1.49 -VALIGN="bottom"
    1.50 -><A
    1.51 -HREF="sdljoystickname.html"
    1.52 -ACCESSKEY="P"
    1.53 ->Prev</A
    1.54 -></TD
    1.55 -><TD
    1.56 -WIDTH="80%"
    1.57 -ALIGN="center"
    1.58 -VALIGN="bottom"
    1.59 -></TD
    1.60 -><TD
    1.61 -WIDTH="10%"
    1.62 -ALIGN="right"
    1.63 -VALIGN="bottom"
    1.64 -><A
    1.65 -HREF="sdljoystickopened.html"
    1.66 -ACCESSKEY="N"
    1.67 ->Next</A
    1.68 -></TD
    1.69 -></TR
    1.70 -></TABLE
    1.71 -><HR
    1.72 -ALIGN="LEFT"
    1.73 -WIDTH="100%"></DIV
    1.74 -><H1
    1.75 -><A
    1.76 -NAME="SDLJOYSTICKOPEN"
    1.77 -></A
    1.78 ->SDL_JoystickOpen</H1
    1.79 -><DIV
    1.80 -CLASS="REFNAMEDIV"
    1.81 -><A
    1.82 -NAME="AEN6096"
    1.83 -></A
    1.84 -><H2
    1.85 ->Name</H2
    1.86 ->SDL_JoystickOpen&nbsp;--&nbsp;Opens a joystick for use.</DIV
    1.87 -><DIV
    1.88 -CLASS="REFSYNOPSISDIV"
    1.89 -><A
    1.90 -NAME="AEN6099"
    1.91 -></A
    1.92 -><H2
    1.93 ->Synopsis</H2
    1.94 -><DIV
    1.95 -CLASS="FUNCSYNOPSIS"
    1.96 -><A
    1.97 -NAME="AEN6100"
    1.98 -></A
    1.99 -><P
   1.100 -></P
   1.101 -><PRE
   1.102 -CLASS="FUNCSYNOPSISINFO"
   1.103 ->#include "SDL.h"</PRE
   1.104 -><P
   1.105 -><CODE
   1.106 -><CODE
   1.107 -CLASS="FUNCDEF"
   1.108 ->SDL_Joystick *<B
   1.109 -CLASS="FSFUNC"
   1.110 ->SDL_JoystickOpen</B
   1.111 -></CODE
   1.112 ->(int index);</CODE
   1.113 -></P
   1.114 -><P
   1.115 -></P
   1.116 -></DIV
   1.117 -></DIV
   1.118 -><DIV
   1.119 -CLASS="REFSECT1"
   1.120 -><A
   1.121 -NAME="AEN6106"
   1.122 -></A
   1.123 -><H2
   1.124 ->Description</H2
   1.125 -><P
   1.126 ->Opens a joystick for use within SDL. The <TT
   1.127 -CLASS="PARAMETER"
   1.128 -><I
   1.129 ->index</I
   1.130 -></TT
   1.131 -> refers to the N'th joystick in the system. A joystick must be opened before it game be used.</P
   1.132 -></DIV
   1.133 -><DIV
   1.134 -CLASS="REFSECT1"
   1.135 -><A
   1.136 -NAME="AEN6110"
   1.137 -></A
   1.138 -><H2
   1.139 ->Return Value</H2
   1.140 -><P
   1.141 ->Returns a <SPAN
   1.142 -CLASS="STRUCTNAME"
   1.143 ->SDL_Joystick</SPAN
   1.144 -> structure on success. <SPAN
   1.145 -CLASS="RETURNVALUE"
   1.146 ->NULL</SPAN
   1.147 -> on failure.</P
   1.148 -></DIV
   1.149 -><DIV
   1.150 -CLASS="REFSECT1"
   1.151 -><A
   1.152 -NAME="AEN6115"
   1.153 -></A
   1.154 -><H2
   1.155 ->Examples</H2
   1.156 -><P
   1.157 -><PRE
   1.158 -CLASS="PROGRAMLISTING"
   1.159 ->SDL_Joystick *joy;
   1.160 -// Check for joystick
   1.161 -if(SDL_NumJoysticks()&#62;0){
   1.162 -  // Open joystick
   1.163 -  joy=SDL_JoystickOpen(0);
   1.164 -  
   1.165 -  if(joy)
   1.166 -  {
   1.167 -    printf("Opened Joystick 0\n");
   1.168 -    printf("Name: %s\n", SDL_JoystickName(0));
   1.169 -    printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
   1.170 -    printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
   1.171 -    printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
   1.172 -  }
   1.173 -  else
   1.174 -    printf("Couldn't open Joystick 0\n");
   1.175 -  
   1.176 -  // Close if opened
   1.177 -  if(SDL_JoystickOpened(0))
   1.178 -    SDL_JoystickClose(joy);
   1.179 -}</PRE
   1.180 -></P
   1.181 -></DIV
   1.182 -><DIV
   1.183 -CLASS="REFSECT1"
   1.184 -><A
   1.185 -NAME="AEN6119"
   1.186 -></A
   1.187 -><H2
   1.188 ->See Also</H2
   1.189 -><P
   1.190 -><A
   1.191 -HREF="sdljoystickclose.html"
   1.192 -><TT
   1.193 -CLASS="FUNCTION"
   1.194 ->SDL_JoystickClose</TT
   1.195 -></A
   1.196 -></P
   1.197 -></DIV
   1.198 -><DIV
   1.199 -CLASS="NAVFOOTER"
   1.200 -><HR
   1.201 -ALIGN="LEFT"
   1.202 -WIDTH="100%"><TABLE
   1.203 -SUMMARY="Footer navigation table"
   1.204 -WIDTH="100%"
   1.205 -BORDER="0"
   1.206 -CELLPADDING="0"
   1.207 -CELLSPACING="0"
   1.208 -><TR
   1.209 -><TD
   1.210 -WIDTH="33%"
   1.211 -ALIGN="left"
   1.212 -VALIGN="top"
   1.213 -><A
   1.214 -HREF="sdljoystickname.html"
   1.215 -ACCESSKEY="P"
   1.216 ->Prev</A
   1.217 -></TD
   1.218 -><TD
   1.219 -WIDTH="34%"
   1.220 -ALIGN="center"
   1.221 -VALIGN="top"
   1.222 -><A
   1.223 -HREF="index.html"
   1.224 -ACCESSKEY="H"
   1.225 ->Home</A
   1.226 -></TD
   1.227 -><TD
   1.228 -WIDTH="33%"
   1.229 -ALIGN="right"
   1.230 -VALIGN="top"
   1.231 -><A
   1.232 -HREF="sdljoystickopened.html"
   1.233 -ACCESSKEY="N"
   1.234 ->Next</A
   1.235 -></TD
   1.236 -></TR
   1.237 -><TR
   1.238 -><TD
   1.239 -WIDTH="33%"
   1.240 -ALIGN="left"
   1.241 -VALIGN="top"
   1.242 ->SDL_JoystickName</TD
   1.243 -><TD
   1.244 -WIDTH="34%"
   1.245 -ALIGN="center"
   1.246 -VALIGN="top"
   1.247 -><A
   1.248 -HREF="joystick.html"
   1.249 -ACCESSKEY="U"
   1.250 ->Up</A
   1.251 -></TD
   1.252 -><TD
   1.253 -WIDTH="33%"
   1.254 -ALIGN="right"
   1.255 -VALIGN="top"
   1.256 ->SDL_JoystickOpened</TD
   1.257 -></TR
   1.258 -></TABLE
   1.259 -></DIV
   1.260 -></BODY
   1.261 -></HTML
   1.262 ->
   1.263 \ No newline at end of file