comparison docs/html/sdljoystickopen.html @ 181:e5bc29de3f0a

Updated from the SDL Documentation Project
author Sam Lantinga <slouken@libsdl.org>
date Fri, 14 Sep 2001 02:41:09 +0000
parents 55f1f1b3e27d
children 355632dca928
comparison
equal deleted inserted replaced
180:578815880307 181:e5bc29de3f0a
71 >SDL_JoystickOpen</A 71 >SDL_JoystickOpen</A
72 ></H1 72 ></H1
73 ><DIV 73 ><DIV
74 CLASS="REFNAMEDIV" 74 CLASS="REFNAMEDIV"
75 ><A 75 ><A
76 NAME="AEN5549" 76 NAME="AEN5708"
77 ></A 77 ></A
78 ><H2 78 ><H2
79 >Name</H2 79 >Name</H2
80 >SDL_JoystickOpen&nbsp;--&nbsp;Opens a joystick for use.</DIV 80 >SDL_JoystickOpen&nbsp;--&nbsp;Opens a joystick for use.</DIV
81 ><DIV 81 ><DIV
82 CLASS="REFSYNOPSISDIV" 82 CLASS="REFSYNOPSISDIV"
83 ><A 83 ><A
84 NAME="AEN5552" 84 NAME="AEN5711"
85 ></A 85 ></A
86 ><H2 86 ><H2
87 >Synopsis</H2 87 >Synopsis</H2
88 ><DIV 88 ><DIV
89 CLASS="FUNCSYNOPSIS" 89 CLASS="FUNCSYNOPSIS"
90 ><A 90 ><A
91 NAME="AEN5553" 91 NAME="AEN5712"
92 ></A 92 ></A
93 ><P 93 ><P
94 ></P 94 ></P
95 ><PRE 95 ><PRE
96 CLASS="FUNCSYNOPSISINFO" 96 CLASS="FUNCSYNOPSISINFO"
110 ></DIV 110 ></DIV
111 ></DIV 111 ></DIV
112 ><DIV 112 ><DIV
113 CLASS="REFSECT1" 113 CLASS="REFSECT1"
114 ><A 114 ><A
115 NAME="AEN5559" 115 NAME="AEN5718"
116 ></A 116 ></A
117 ><H2 117 ><H2
118 >Description</H2 118 >Description</H2
119 ><P 119 ><P
120 >Opens a joystick for use within SDL. The <TT 120 >Opens a joystick for use within SDL. The <TT
125 > refers to the N'th joystick in the system. A joystick must be opened before it game be used.</P 125 > refers to the N'th joystick in the system. A joystick must be opened before it game be used.</P
126 ></DIV 126 ></DIV
127 ><DIV 127 ><DIV
128 CLASS="REFSECT1" 128 CLASS="REFSECT1"
129 ><A 129 ><A
130 NAME="AEN5563" 130 NAME="AEN5722"
131 ></A 131 ></A
132 ><H2 132 ><H2
133 >Return Value</H2 133 >Return Value</H2
134 ><P 134 ><P
135 >Returns a <SPAN 135 >Returns a <SPAN
141 > on failure.</P 141 > on failure.</P
142 ></DIV 142 ></DIV
143 ><DIV 143 ><DIV
144 CLASS="REFSECT1" 144 CLASS="REFSECT1"
145 ><A 145 ><A
146 NAME="AEN5568" 146 NAME="AEN5727"
147 ></A 147 ></A
148 ><H2 148 ><H2
149 >Examples</H2 149 >Examples</H2
150 ><P 150 ><P
151 ><PRE 151 ><PRE
158 158
159 if(joy) 159 if(joy)
160 { 160 {
161 printf("Opened Joystick 0\n"); 161 printf("Opened Joystick 0\n");
162 printf("Name: %s\n", SDL_JoystickName(0)); 162 printf("Name: %s\n", SDL_JoystickName(0));
163 printf("Number of Axes: %s\n", SDL_JoystickNumAxes(joy)); 163 printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
164 printf("Number of Buttons: %s\n", SDL_JoystickNumButtons(joy)); 164 printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
165 printf("Number of Balls: %s\n", SDL_JoystickNumBalls(joy)); 165 printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
166 } 166 }
167 else 167 else
168 printf("Couldn't open Joystick 0\n"); 168 printf("Couldn't open Joystick 0\n");
169 169
170 // Close if opened 170 // Close if opened
174 ></P 174 ></P
175 ></DIV 175 ></DIV
176 ><DIV 176 ><DIV
177 CLASS="REFSECT1" 177 CLASS="REFSECT1"
178 ><A 178 ><A
179 NAME="AEN5572" 179 NAME="AEN5731"
180 ></A 180 ></A
181 ><H2 181 ><H2
182 >See Also</H2 182 >See Also</H2
183 ><P 183 ><P
184 ><A 184 ><A