OSDN Git Service

Mix_EachSoundFont 新規追加
[sdl2referencejp/sdl2referencejp.git] / SDL_GetBasePath.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html lang="ja-JP">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <meta name="keywords" content="Simple Directmedia Layer SDL2.0">
7 <link rel="top" href="index.html" title="\83z\81[\83\80">
8 <link rel="parent" href="CategoryFileSystem.html" title="1\82Â\8fã">
9 <title>SDL_GetBasePath</title>
10 </head>
11 <body>
12 <a href="index.html">\96Ú\8e\9f</a> - <a href="ApiByCategory.html">API(\8b@\94\\95Ê)</a> - <a href="CategoryFileSystem.html">\83t\83@\83C\83\8b\83V\83X\83e\83\80</a> - SDL_GetBasePath
13 <hr>
14 <h1>SDL_GetBasePath</h1>
15 \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ð\8bN\93®\82µ\82½\83f\83B\83\8c\83N\83g\83\8a\82ð\93¾\82é. \82±\82±\82ª\83A\83v\83\8a\83P\81[\83V\83\87\83\93\83f\81[\83^\83f\83B\83\8c\83N\83g\83\8a\82Å\82 \82é.
16 <h2>\8d\\95¶</h2>
17 <code>char* SDL_GetBasePath(void)</code>
18 <h2>\96ß\82è\92l</h2>
19 <p>
20 \83A\83v\83\8a\83P\81[\83V\83\87\83\93\83f\81[\83^\83f\83B\83\8c\83N\83g\83\8a\82ÌUTF-8\82Ì\90â\91Î\83p\83X\96¼\82ð\96ß\82·.
21 \8e¸\94s\82Ü\82½\82Í\82±\82Ì\8aÖ\90\94\82ª\8eÀ\91\95\82³\82ê\82Ä\82¢\82È\82¢\8aÂ\8b«\82Ì\8fê\8d\87NULL\82ð\96ß\82·.
22 <a href="SDL_GetError.html">SDL_GetError()</a>\82Å\8fÚ\8d×\82ð\92m\82é\82±\82Æ\82ª\82Å\82«\82é.
23 </p>
24 <h2>\83T\83\93\83v\83\8b\83R\81[\83h</h2>
25 <p>
26 <code>
27 <pre>
28 char *data_path = NULL;
29
30 void InitializeDataPath() {
31     char *base_path = SDL_GetBasePath();
32     if (base_path) {
33         data_path = base_path;
34     } else {
35         data_path = SDL_strdup("./");
36     }
37 }
38 </pre>
39 </code>
40 </p>
41 <h2>\8fÚ\8d×</h2>
42 <p>
43 \82±\82Ì\8aÖ\90\94\82Í\8d\82\91¬\82Å\82 \82é\95K\97v\82Í\82È\82¢\82Í\82¸\82¾. \82»\82ê\82Å\82à\91¬\82³\82ª\95K\97v\82È\82ç\82Î, \8dÅ\8f\89\82É\8cÄ\82ñ\82¾\82Æ\82«\82É\95\8e\9a\97ñ\82ð\95Û\91\82·\82é\95K\97v\82ª\82 \82é.
44 </p>
45 <p>
46 <strong>Mac OS X\82ÆiOS\82Ì\93Á\95Ê\82È\8ed\97l:</strong>
47 \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ª".app"\83o\83\93\83h\83\8b\82³\82ê\82Ä\82¢\82ê\82Î, \82±\82Ì\8aÖ\90\94\82Í\83\8a\83\\81[\83X\83f\83B\83\8c\83N\83g\83\8a(\97á: MyApp.app/Contents/Resources/)\82ð\96ß\82·.
48 \82±\82Ì\93®\8dì\82ÍInfo.plist\82É\83v\83\8d\83p\83e\83B\82ð\92Ç\89Á\82µ\82Ä\8fã\8f\91\82«\82Å\82«\82é.
49 SDL_FILESYSTEM_BASE_DIR_TYPE \95\8e\9a\97ñ\83L\81[\82É\92l\82ð\92Ç\89Á\82·\82é\82Æ\93®\8dì\82ð\95Ï\82¦\82ç\82ê\82é.
50 </p>
51 <p>
52 SDL_FILESYSTEM_BASE_DIR_TYPE \83v\83\8d\83p\83e\83B\82Ì\92l (\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Í /Applications/SDLApp/MyApp.app \82É\82 \82é\82Æ\82·\82é):
53 <table border="1" summary="">
54 <tr><th>\92l</th><th>\90à\96¾</th><th>\97á</th></tr>
55 <tr><th>resource</th><td>\83o\83\93\83h\83\8b\82³\82ê\82½\83\8a\83\\81[\83X\83f\83B\83\8c\83N\83g\83\8a (\83f\83t\83H\83\8b\83g)</td><td>/Applications/SDLApp/MyApp.app/Contents/Resources</td></tr>
56 <tr><th>bundle</th><td>\83o\83\93\83h\83\8b\83f\83B\83\8c\83N\83g\83\8a</td><td>/Applications/SDLApp/MyApp.app/</td></tr>
57 <tr><th>parent</th><td>\83o\83\93\83h\83\8b\83f\83B\83\8c\83N\83g\83\8a\82Ì\82 \82é\83f\83B\83\8c\83N\83g\83\8a</td><td>/Applications/SDLApp/</td></tr>
58 </table>
59 </p>
60 <p>
61 <strong>\83j\83\93\83e\83\93\83h\81[DS\82Ì\93Á\95Ê\82È\8ed\97l:</strong>
62 \8eÀ\8ds\83t\83@\83C\83\8b\82Ì\8aO\95\94\82É\83\8a\83\\81[\83X\82ð\92u\82­\82±\82Æ\82ª\88ê\94Ê\93I\82Å\82È\82¢\82½\82ß, \82±\82Ì\8aÖ\90\94\82Í\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì"romfs"\83f\83B\83\8c\83N\83g\83\8a\82ð\96ß\82·.
63 \82±\82Ì\83f\83B\83\8c\83N\83g\83\8a\82Í\8f\91\82«\8d\9e\82Ý\95s\89Â\82Å\82 \82é.
64 </p>
65 <p>
66 \96ß\82³\82ê\82½\83p\83X\82Í\8dÅ\8cã\82ª\8bæ\90Ø\82è\8bL\8d\86(Windows\82È\82ç'\', \91¼\82Ì\8aÂ\8b«\82È\82ç'/')\82Å\8fI\82í\82Á\82Ä\82¢\82é\82±\82Æ\82ª\95Û\8fá\82³\82ê\82Ä\82¢\82é.
67 </p>
68 <p>
69 \82±\82Ì\83|\83C\83\93\83^\82Ì\8aÇ\97\9d\82Í\83v\83\8d\83O\83\89\83}\82ª\8ds\82¤.
70 \8eg\82¢\8fI\82í\82Á\82½\82çSDL_free()\82ð\8cÄ\82Ô\95K\97v\82ª\82 \82é.
71 </p>
72 <h2>\83o\81[\83W\83\87\83\93</h2>
73 SDL 2.0.1\88È\8d~
74 <h2>\8aÖ\98A\8d\80\96Ú(\8aÖ\90\94)</h2>
75 <a href="SDL_GetPrefPath.html">SDL_GetPrefPath</a><br>
76 <h2>SDL Wiki\82Ö\82Ì\83\8a\83\93\83N</h2>
77 <a href="https://wiki.libsdl.org/SDL_GetBasePath">SDL_GetBasePath - SDL Wiki</a>
78 <hr>
79 </body>
80 </html>