1190
|
1 |
|
|
2 |
===========
|
|
3 |
SDL on OS/2
|
|
4 |
===========
|
|
5 |
|
|
6 |
Last updated on Oct 02, 2005.
|
|
7 |
|
|
8 |
|
|
9 |
1. How to compile?
|
|
10 |
------------------
|
|
11 |
|
|
12 |
To compile this, you'll need the followings installed:
|
|
13 |
- The OS/2 Developer's Toolkit
|
|
14 |
- The OpenWatcom compiler
|
|
15 |
(http://www.openwatcom.org)
|
|
16 |
- The FSLib library
|
|
17 |
(ftp://ftp.netlabs.org/pub/SDL)
|
|
18 |
|
|
19 |
Please edit the second, fourth and fifth lines of setvars.cmd file
|
|
20 |
to set the folders where the toolkit, the OW compiler and the FSLib are.
|
|
21 |
You won't need NASM yet (The Netwide Assembler), you can leave that line.
|
|
22 |
Run setvars.cmd, and you should get a shell in which you can
|
|
23 |
compile SDL.
|
|
24 |
|
|
25 |
Check the "Watcom.mif" file. This is the file which is included by all the
|
|
26 |
Watcom makefiles, so changes here will affect the whole build process.
|
|
27 |
There is a line in there which determines if the resulting SDL.DLL will be
|
|
28 |
a 'debug' or a 'release' build. The 'debug' version is full of printf()'s,
|
|
29 |
so if something goes wrong, its output can help a lot for debugging.
|
|
30 |
|
|
31 |
Then go to the 'src' folder, and run "wmake -f makefile.wat".
|
|
32 |
This should create the SDL.DLL and the corresponding SDL.LIB file there.
|
|
33 |
|
|
34 |
To test applications, it's a good idea to use the 'debug' build of SDL, and
|
|
35 |
redirect the standard output and standard error output to files, to see what
|
|
36 |
happens internally in SDL.
|
|
37 |
(like: testsprite >stdout.txt 2>stderr.txt)
|
|
38 |
|
|
39 |
To rebuild SDL, use the following commands in 'src' folder:
|
|
40 |
wmake -f makefile.wat clean
|
|
41 |
wmake -f makefile.wat
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
2. How to compile the testapps?
|
|
46 |
-------------------------------
|
|
47 |
|
|
48 |
Once you have SDL.DLL compiled, navigate into the 'test' folder, copy in there
|
|
49 |
the newly built SDL.DLL, and copy in there FSLib.DLL.
|
|
50 |
|
|
51 |
Then run "wmake -f makefile.wat" in there to compile some of the testapps.
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
3. What is missing?
|
|
56 |
-------------------
|
|
57 |
|
|
58 |
The following things are missing from this SDL implementation:
|
|
59 |
- MMX, SSE and 3DNOW! optimized video blitters?
|
|
60 |
- HW Video surfaces
|
|
61 |
- OpenGL support
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
4. Special Keys / Full-Screen support
|
|
66 |
-------------------------------------
|
|
67 |
|
|
68 |
There are two special hot-keys implemented:
|
|
69 |
- Alt+Home switches between fullscreen and windowed mode
|
|
70 |
- Alt+End simulates closing the window (can be used as a Panic key)
|
|
71 |
Only the LEFT Alt key will work.
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
5. Joysticks on SDL/2
|
|
76 |
---------------------
|
|
77 |
|
|
78 |
The Joystick detection only works for standard joysticks (2 buttons, 2 axes
|
|
79 |
and the like). Therefore, if you use a non-standard joystick, you should
|
|
80 |
specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
|
|
81 |
file or CONFIG.SYS, so SDL applications can provide full capability to your
|
|
82 |
device. The syntax is:
|
|
83 |
|
|
84 |
SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
|
|
85 |
|
|
86 |
So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
|
|
87 |
the line should be:
|
|
88 |
|
|
89 |
SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
|
|
90 |
|
|
91 |
If you want to add spaces in your joystick name, just surround it with
|
|
92 |
quotes or double-quotes:
|
|
93 |
|
|
94 |
SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
|
|
95 |
|
|
96 |
or
|
|
97 |
|
|
98 |
SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
|
|
99 |
|
|
100 |
Notive However that Balls and Hats are not supported under OS/2, and the
|
|
101 |
value will be ignored... but it is wise to define these correctly because
|
|
102 |
in the future those can be supported.
|
|
103 |
Also the number of buttons is limited to 2 when using two joysticks,
|
|
104 |
4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
|
|
105 |
and 8 when using a joystick with 2 axes. Notice however these are limitations
|
|
106 |
of the Joystick Port hardware, not OS/2.
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
6. Next steps...
|
|
111 |
----------------
|
|
112 |
|
|
113 |
Things to do:
|
|
114 |
- Implement missing stuffs (look for 'TODO' string in source code!)
|
|
115 |
- Finish video driver (the 'wincommon' can be a good example for missing
|
|
116 |
things like application icon and so on...)
|
|
117 |
- Enable MMX/SSE/SSE2 acceleration functions
|
|
118 |
- Rewrite CDROM support using DOS Ioctl for better support.
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
7. Contacts
|
|
123 |
-----------
|
|
124 |
|
|
125 |
You can contact the developers for bugs:
|
|
126 |
|
|
127 |
Area Developer email
|
|
128 |
General (Audio/Video/System) Doodle doodle@scenergy.dfmk.hu
|
|
129 |
CDROM and Joystick Caetano daniel@caetano.eng.br
|
|
130 |
|
|
131 |
Notice however that SDL/2 is 'in development' stage so ... if you want to help,
|
|
132 |
please, be our guest and contact us!
|
|
133 |
|