comparison README.MacOSX @ 172:37e3ca9254c7

Date: Sat, 8 Sep 2001 04:42:23 +0200 From: Max Horn <max@quendi.de> Subject: SDL/OSX: Joystick; Better key handling I just finished implementing improved keyhandling for OS X (in fact the code should be easily ported to the "normal" MacOS part of SDL, I just had no chance yet). Works like this: First init the mapping table statically like before. Them, it queries the OS for the "official" key table, then iterates over all 127 scancode and gets the associates ascii code. It ignores everythng below 32 (has to, as it would lead to many problems if we did not... e.g. both ESC and NUM LOCk produce an ascii code 27 on my keyboard), and all stuff above 127 is mapped to SDLK_WORLD_* simply in the order it is encountered. In addition, caps lock is now working, too. The code work flawless for me, but since I only have one keyboard, I may have not encountered some serious problem... but I am pretty confident that it is better than the old code in most cases. The joystick driver works fine for me, too. I think it can be added to CVS already. It would simply be helpful if more people would test it. Hm, I wonder if Maelstrom or GLTron has Joystick support? That would be a wonderful test application :) I also took the liberty of modifying some text files like BUGS, README.CVS, README.MacOSX (which now contains the OS X docs I long promised)
author Sam Lantinga <slouken@libsdl.org>
date Tue, 11 Sep 2001 19:00:18 +0000
parents 25dfe480c75e
children c151cfc43c07
comparison
equal deleted inserted replaced
171:02e27b705645 172:37e3ca9254c7
16 make 16 make
17 make install 17 make install
18 18
19 (You may need to create the subdirs of /usr/local manually.) 19 (You may need to create the subdirs of /usr/local manually.)
20 20
21 For some reason, libtool doesn't run ranlib properly, so do this 21 /*
22 manually:
23
24 ranlib /usr/local/lib/libSDL.a
25
26 To use the library once it's built, you need to use the "Carbon 22 To use the library once it's built, you need to use the "Carbon
27 framework", which is the port of the old Mac Toolbox to OS X. 23 framework", which is the port of the old Mac Toolbox to OS X.
28 To do this, use the -F and -framework arguments for compiling 24 To do this, use the -F and -framework arguments for compiling
29 and linking, respectively: 25 and linking, respectively:
30 26
31 cc -c myprog.c -I/usr/local/include/SDL -F/System/Library/Frameworks/Carbon.framework 27 cc -c myprog.c -I/usr/local/include/SDL -F/System/Library/Frameworks/Carbon.framework
32 cc myprog.o -L/usr/local/lib -lSDL -framework Carbon 28 cc myprog.o -L/usr/local/lib -lSDL -framework Carbon
33 29
34 sdl-config knows about the linking path and -framework, so it's 30 sdl-config knows about the linking path and -framework, so it's
35 recommended to use it to fill in your Makefile variables. 31 recommended to use it to fill in your Makefile variables.
32 */
33
34 To use the library once it's built, you essential have two possibilities:
35 use the traditional autoconf/automake/make method, or use Apple's Project Builder.
36
37 ==============================================================================
38 Using the Simple DirectMedia Layer with a traditional Makefile
39 ==============================================================================
40
41 In the following, it will be mostly assumed that you are using autoconf and
42 automake to setup your SDL project, and furthermore that you use the AM_PATH_SDL
43 macro provided by SDL in sdl.m4. If you are not using these tools, you can
44 still use SDL but it will be somewhat hard to get running.
45
46 Only step 1) is really required to get started, but for full OS X support you
47 will want to do the other steps, too.
48
49 1) Update your acinclude.m4 file in case you have copied an older version of
50 sdl.m4 into it. This is essential as AM_PATH_SDL now performs some additional
51 tasks when used on MacOS X
52
53 Rationale: AM_PATH_SDL copies /usr/local/share/sdl/Info.plist and the folder
54 /usr/local/share/sdl/SDLMain.nib/ into the directory where configure is invoked.
55 This is essential for the configure script to be able to run the test code
56 that detects SDL.
57
58 2) Copy SDL's Info.plist.in file (from src/main/macosx) into your project's main
59 folder (the same spot that your configure.in sits), and edit it to suite your
60 needs. Then add it to your AC_OUTPUT list in configure.in
61
62 Rationale: The Info.plist file can be used to specify an icon file for
63 your app, and also to provide a human readable version/copyright string
64 and other meta-information to the user via the Finder's Get Info dialog.
65
66 3) Add something like the following rule to your Makefile.am:
67
68 APP_NAME.app: EXE_NAME
69 mkdir -p $@/Contents/MacOS
70 mkdir -p $@/Contents/Resources
71 mkdir -p $@/Contents/Resources/SDLMain.nib
72 echo "APPL????" > $@/Contents/PkgInfo
73 $(INSTALL_DATA) Info.plist $@/Contents/
74 $(INSTALL_DATA) SDLMain.nib/*.nib $@/Contents/Resources/
75 $(INSTALL_PROGRAM) $< $@/Contents/MacOS/
76
77 You should replace EXE_NAME with the name of the executable. APP_NAME is what
78 will be visible to the user in the Finder. Usually it will be the same
79 as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
80 usually is "TestGame"
81
82 If your project builds more than one application, you will have to do a bit more.
83 For each of your target applications, you need a seperate rule. Furthermore, each
84 needs its own Info.plist file, since that has to contain the exact name of the
85 executable (i.e. EXE_NAME above). One way to do that is to use sed in your make rules
86 and modify a single master Info.plist.
87
88 Rationale: on Mac OS X, executables have to be put into so-called "bundles".
89 The make rule given above will construct such a bundle around the executable
90 for you. You need to make a copy of it for each target application.
91
92 4) If you want the create bundles to be installed, you may want to add this
93 rule to your Makefile.am:
94
95 install-exec-local: Exult.app
96 mkdir -p /Applications/
97 cp -r $< /Applications/
98
99 This rule takes the Bundle created by the rule from step 3 and installs them
100 into /Applications/. An alternate installation place would be $HOME/Applications/
101
102 Again, if you want to install multiple applications, you will have to augment
103 the make rule accordingly.
104
36 105
37 ============================================================================== 106 ==============================================================================
38 Using the Simple DirectMedia Layer with Project Builder 107 Using the Simple DirectMedia Layer with Project Builder
39 ============================================================================== 108 ==============================================================================
40 109
120 from the Developer Tools CD for May 2001. 189 from the Developer Tools CD for May 2001.
121 As of May 31 2001, Apple hasn't released this version of the tools to the public, 190 As of May 31 2001, Apple hasn't released this version of the tools to the public,
122 but I expect that things will still work on older versions. 191 but I expect that things will still work on older versions.
123 192
124 Known bugs are listed in the file "BUGS" 193 Known bugs are listed in the file "BUGS"
194 LocalWords: Stuffit