1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
\r
4 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
\r
5 <meta http-equiv="Content-Style-Type" content="text/css">
\r
6 <meta name="keywords" content="Simple Directmedia Layer SDL2.0">
\r
7 <link rel="top" href="index.html" title="
\83z
\81[
\83\80">
\r
8 <link rel="parent" href="CategoryGameController.html" title="1
\82Â
\8fã">
\r
9 <title>SDL_GameControllerOpen</title>
\r
12 <a href="index.html">
\96Ú
\8e\9f</a> - <a href="ApiByCategory.html">API(
\8b@
\94\
\95Ê)</a> - <a href="CategoryGameController.html">
\83Q
\81[
\83\80\83R
\83\93\83g
\83\8d\81[
\83\89\81[</a> - SDL_GameControllerOpen
\r
14 <h1>SDL_GameControllerOpen</h1>
\r
15 \83Q
\81[
\83\80\83R
\83\93\83g
\83\8d\81[
\83\89\81[
\82ð
\8eg
\82¤
\82½
\82ß
\82É
\8aJ
\82
\r
17 <code>SDL_GameController* SDL_GameControllerOpen(int joystick_index)</code>
\r
19 <table border="1" summary="SDL_GameControllerOpen">
\r
20 <tr><td>joystick_index</td><td><a href="SDL_NumJoysticks.html">SDL_NumJoysticks()</a>
\8cÂ
\82Ü
\82Å
\82Ì
\83f
\83o
\83C
\83X
\82Ì
\94Ô
\8d\86</td></tr>
\r
22 <h2>
\96ß
\82è
\92l</h2>
\r
23 \90¬
\8c÷
\82Ì
\82Æ
\82«
\83Q
\81[
\83\80\83R
\83\93\83g
\83\8d\81[
\83\89\81[
\8e¯
\95Ê
\8eq,
\8e¸
\94s
\82Ì
\82Æ
\82«NULL
\82ð
\96ß
\82·.
\r
24 <a href="SDL_GetError.html">SDL_GetError()</a>
\82Å
\8fÚ
\8d×
\82ð
\92m
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82é.
\r
25 <h2>
\83T
\83\93\83v
\83\8b\83R
\81[
\83h</h2>
\r
29 /*
\97\98\97p
\89Â
\94\
\82È
\8dÅ
\8f\89\82Ì
\83R
\83\93\83g
\83\8d\81[
\83\89\81[
\82ð
\8aJ
\82 */
\r
30 SDL_GameController *controller = NULL;
\r
31 for (int i = 0; i < SDL_NumJoysticks(); ++i) {
\r
32 if (SDL_IsGameController(i)) {
\r
33 controller = SDL_GameControllerOpen(i);
\r
37 fprintf(stderr, "
\83Q
\81[
\83\80\83R
\83\93\83g
\83\8d\81[
\83\89\81[%d
\82ð
\8aJ
\82¯
\82È
\82©
\82Á
\82½: %s\n", i, SDL_GetError());
\r
46 device_index
\82Í<a href="SDL_JoystickOpen.html">SDL_JoystickOpen()</a>
\82Ì
\88ø
\90\94\82Ìjoystick_index
\82Æ
\93¯
\82¶
\82Å
\82 \82é.
\r
49 \88ø
\90\94\82Ìjoystick_index
\82Í,
\82»
\82Ì
\83V
\83X
\83e
\83\80\82ÌN
\94Ô
\96Ú
\82Ì
\83Q
\81[
\83\80\83R
\83\93\83g
\83\8d\81[
\83\89\82ð
\95\
\82·.
\r
50 joystick_index
\82Ì
\92l
\82Í,
\8cã
\82Ì
\83R
\83\93\83g
\83\8d\81[
\83\89\81[
\83C
\83x
\83\93\83g
\82Å
\82±
\82Ì
\83R
\83\93\83g
\83\8d\81[
\83\89\81[
\82ð
\8e¯
\95Ê
\82·
\82é
\92l
\82Æ
\82Í
\95Ê
\82Å
\82 \82é.
\r
51 \91ã
\82í
\82è
\82É
\83W
\83\87\83C
\83X
\83e
\83B
\83b
\83N
\82Ì
\83C
\83\93\83X
\83^
\83\93\83XID(SDL_JoystickID)
\82ª
\8eg
\82í
\82ê
\82é.
\r
53 <h2>
\83o
\81[
\83W
\83\87\83\93</h2>
\r
57 <h2>
\8aÖ
\98A
\8d\80\96Ú(
\8aÖ
\90\94)</h2>
\r
58 <a href="SDL_GameControllerClose.html">SDL_GameControllerClose</a><br>
\r
59 <a href="SDL_GameControllerNameForIndex.html">SDL_GameControllerNameForIndex</a><br>
\r
60 <a href="SDL_IsGameController.html">SDL_IsGameController</a><br>
\r
61 <h2>SDL Wiki
\82Ö
\82Ì
\83\8a\83\93\83N</h2>
\r
62 <a href="https://wiki.libsdl.org/SDL_GameControllerOpen">SDL_GameControllerOpen - SDL Wiki</a>
\r