frusdl 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,100 @@
1
+ # Copyright (c) 2008, Bjorn De Meyer
2
+ #
3
+ # This software is provided 'as-is', without any express or implied
4
+ # warranty. In no event will the authors be held liable for any damages
5
+ # arising from the use of this software.
6
+ #
7
+ # Permission is granted to anyone to use this software for any purpose,
8
+ # including commercial applications, and to alter it and redistribute it
9
+ # freely, subject to the following restrictions:
10
+ # 1. The origin of this software must not be misrepresented; you must not
11
+ # claim that you wrote the original software. If you use this software
12
+ # in a product, an acknowledgment in the product documentation would be
13
+ # appreciated but is not required.
14
+ #
15
+ # 2. Altered source versions must be plainly marked as such, and must not be
16
+ # misrepresented as being the original software.
17
+ #
18
+ # 3. This notice may not be removed or altered from any source
19
+ # distribution.
20
+
21
+
22
+ module Frusdl
23
+ module Low
24
+ # SDL graphical extensions. Useful addon lib
25
+ module SGE
26
+ extend FFI::Library
27
+ ffi_lib('SGE')
28
+ # collision data
29
+ class Sge_cdata < FFI::Struct
30
+ layout :map => :pointer,
31
+ :w => :ushort,
32
+ :h => :ushort
33
+ end
34
+
35
+
36
+ attach_function :sge_make_cmap , [:pointer], :pointer
37
+ attach_function :sge_bbcheck , [:pointer, :short, :short, :pointer, :short, :short], :int
38
+ attach_function :sge_cmcheck , [:pointer, :short, :short, :pointer, :short, :short], :int
39
+ attach_function :sge_get_cx , [], :short
40
+ attach_function :sge_get_cy , [], :short
41
+ attach_function :sge_destroy_cmap , [:pointer], :pointer
42
+ attach_function :sge_unset_cdata , [:pointer, :short, :short, :short, :short], :void
43
+ attach_function :sge_set_cdata , [:pointer, :short, :short, :short, :short], :void
44
+ attach_function :sge_HLine , [:pointer, :short, :short, :short, :ulong], :void
45
+ attach_function :sge_HLineAlpha , [:pointer, :short, :short, :short, :ulong , :uchar], :void
46
+ attach_function :sge_VLine , [:pointer, :short, :short, :short, :ulong], :void
47
+ attach_function :sge_VLineAlpha , [:pointer, :short, :short, :short, :ulong , :uchar], :void
48
+ attach_function :sge_Line , [:pointer, :short, :short, :short, :short , :ulong], :void
49
+ attach_function :sge_LineAlpha , [:pointer, :short, :short, :short, :short , :ulong, :uchar], :void
50
+ attach_function :sge_AALine , [:pointer, :short, :short, :short, :short , :ulong], :void
51
+ attach_function :sge_AALineAlpha , [:pointer, :short, :short, :short, :short , :ulong, :uchar], :void
52
+
53
+ attach_function :sge_mcLine, [:pointer, :short, :short, :short, :short , :uchar, :uchar, :uchar, :uchar, :uchar, :uchar], :void
54
+ attach_function :sge_mcLineAlpha, [:pointer, :short, :short, :short, :short , :uchar, :uchar, :uchar, :uchar, :uchar, :uchar, :uchar], :void
55
+ attach_function :sge_AAmcLine, [:pointer, :short, :short, :short, :short , :uchar, :uchar, :uchar, :uchar, :uchar, :uchar], :void
56
+ attach_function :sge_AAmcLineAlpha, [:pointer, :short, :short, :short, :short , :uchar, :uchar, :uchar, :uchar, :uchar, :uchar, :uchar], :void
57
+
58
+
59
+
60
+ attach_function :sge_DoLine , [:pointer, :short, :short, :short, :short , :ulong, :pointer], :void
61
+ attach_function :sge_DomcLine , [:pointer, :short, :short, :short, :short , :uchar, :uchar, :uchar, :uchar, :uchar, :uchar, :pointer], :void
62
+ attach_function :sge_DoEllipse, [:pointer, :short, :short, :short, :short , :ulong, :pointer], :void
63
+ attach_function :sge_DoCircle , [:pointer, :short, :short, :short, :ulong, :pointer], :void
64
+ # should use Callback(SDL_Surface *Surf, Sint16 X, Sint16 Y, Uint32 Color)
65
+ # in stead of :pointer
66
+
67
+ attach_function :sge_Rect , [:pointer, :short, :short, :short, :short, :ulong] , :void
68
+ attach_function :sge_RectAlpha , [:pointer, :short, :short, :short, :short, :ulong, :uchar], :void
69
+ attach_function :sge_FilledRect , [:pointer, :short, :short, :short, :short, :ulong] , :void
70
+ attach_function :sge_FilledRectAlpha , [:pointer, :short, :short, :short, :short, :ulong, :uchar], :void
71
+ attach_function :sge_Ellipse , [:pointer, :short, :short, :short, :short, :ulong] , :void
72
+ attach_function :sge_EllipseAlpha , [:pointer, :short, :short, :short, :short, :ulong, :uchar], :void
73
+ attach_function :sge_FilledEllipse , [:pointer, :short, :short, :short, :short, :ulong] , :void
74
+ attach_function :sge_FilledEllipseAlpha,[:pointer, :short, :short, :short, :ulong, :uchar], :void
75
+ attach_function :sge_Circle , [:pointer, :short, :short, :short, :ulong] , :void
76
+ attach_function :sge_CircleAlpha , [:pointer, :short, :short, :short, :ulong, :uchar], :void
77
+ attach_function :sge_FilledCircle , [:pointer, :short, :short, :short, :ulong] , :void
78
+ attach_function :sge_FilledCircleAlpha, [:pointer, :short, :short, :short, :ulong, :uchar], :void
79
+ attach_function :sge_AACircle , [:pointer, :short, :short, :short, :ulong] , :void
80
+ attach_function :sge_AACircleAlpha , [:pointer, :short, :short, :short, :ulong, :uchar], :void
81
+ attach_function :sge_AAFilledCircle , [:pointer, :short, :short, :short, :ulong] , :void
82
+ attach_function :sge_Bezier , [:pointer, :short, :short, :short, :short, :short, :short, :short, :short, :ulong] , :void
83
+ attach_function :sge_BezierAlpha , [:pointer, :short, :short, :short, :short, :short, :short, :short, :short, :int, :ulong, :uchar], :void
84
+ attach_function :sge_AABezier , [:pointer, :short, :short, :short, :short, :short, :short, :short, :short, :ulong] , :void
85
+ attach_function :sge_AABezierAlpha , [:pointer, :short, :short, :short, :short, :short, :short, :short, :short, :int, :ulong, :uchar], :void
86
+
87
+
88
+ # Transformation flags
89
+ SGE_TAA = 0x1
90
+ SGE_TSAFE = 0x2
91
+ SGE_TTMAP = 0x4
92
+ attach_function :sge_transform, [:pointer, :pointer, :float, :float, :float, :ushort, :ushort, :ushort, :ushort, :uchar], :pointer # XXX should be SDL_rect
93
+
94
+ attach_function :sge_transform_surface, [:pointer, :ulong, :float, :float, :float, :ushort, :uchar], :pointer
95
+
96
+
97
+ end
98
+
99
+ end # module Low
100
+ end # module Frusdl
@@ -0,0 +1,95 @@
1
+ # Copyright (c) 2008, Bjorn De Meyer
2
+ #
3
+ # This software is provided 'as-is', without any express or implied
4
+ # warranty. In no event will the authors be held liable for any damages
5
+ # arising from the use of this software.
6
+ #
7
+ # Permission is granted to anyone to use this software for any purpose,
8
+ # including commercial applications, and to alter it and redistribute it
9
+ # freely, subject to the following restrictions:
10
+ # 1. The origin of this software must not be misrepresented; you must not
11
+ # claim that you wrote the original software. If you use this software
12
+ # in a product, an acknowledgment in the product documentation would be
13
+ # appreciated but is not required.
14
+ #
15
+ # 2. Altered source versions must be plainly marked as such, and must not be
16
+ # misrepresented as being the original software.
17
+ #
18
+ # 3. This notice may not be removed or altered from any source
19
+ # distribution.
20
+
21
+ module Frusdl
22
+ module Low
23
+ module TTF
24
+ extend FFI::Library
25
+ ffi_lib('SDL_ttf')
26
+
27
+ class TTF_Font < FFI::Struct
28
+ # Private
29
+ end
30
+
31
+ # This function tells the library whether UNICODE text is generally byteswapped.
32
+ attach_function :TTF_ByteSwappedUNICODE, [:int], :void
33
+ # Initialize the TTF engine - returns 0 if successful, -1 on error
34
+ attach_function :TTF_Init , [], :int
35
+ # Open a font file and create a font of the specified point size.
36
+ attach_function :TTF_OpenFont , [:string, :int], :pointer
37
+ attach_function :TTF_OpenFontIndex , [:string, :int, :int], :pointer
38
+ attach_function :TTF_OpenFontRW , [:pointer, :int], :pointer
39
+ attach_function :TTF_OpenFontIndexRW, [:pointer, :int, :int], :pointer
40
+ #
41
+ # Set and retrieve the font style
42
+ TTF_STYLE_NORMAL = 0x00
43
+ TTF_STYLE_BOLD = 0x01
44
+ TTF_STYLE_ITALIC = 0x02
45
+ TTF_STYLE_UNDERLINE = 0x04
46
+
47
+ attach_function :TTF_GetFontStyle , [:pointer], :int
48
+ attach_function :TTF_SetFontStyle , [:pointer, :int], :void
49
+ # Font dimensions
50
+ attach_function :TTF_FontHeight , [:pointer], :int
51
+ attach_function :TTF_FontAscent , [:pointer], :int
52
+ attach_function :TTF_FontDescent , [:pointer], :int
53
+ attach_function :TTF_FontLineSkip , [:pointer], :int
54
+ # Get the number of faces of the font
55
+ attach_function :TTF_FontFaces , [:pointer], :long
56
+
57
+ # Get the font face attributes, if any
58
+ attach_function :TTF_FontFaceIsFixedWidth , [:pointer], :int
59
+ attach_function :TTF_FontFaceFamilyName , [:pointer], :string
60
+ attach_function :TTF_FontFaceStyleName , [:pointer], :string
61
+
62
+ # Get the metrics (dimensions) of a glyph
63
+ attach_function :TTF_GlyphMetrics , [:pointer, :int, :pointer, :pointer, :pointer, :pointer, :pointer], :int
64
+
65
+ # Get the dimensions of a rendered string of text
66
+ attach_function :TTF_SizeText, [:pointer, :string, :pointer, :pointer] , :pointer
67
+ attach_function :TTF_SizeUTF8, [:pointer, :string, :pointer, :pointer] , :pointer
68
+ attach_function :TTF_SizeUNICODE, [:pointer, :pointer, :pointer, :pointer], :pointer
69
+
70
+ # Render text with different levels of smoothing.
71
+ # XXX: SDL_Color is needed here everywhere, but it is of same size as :ulong
72
+ attach_function :TTF_RenderText_Solid, [:pointer, :string, :ulong] , :pointer
73
+ attach_function :TTF_RenderUTF8_Solid, [:pointer, :string, :ulong] , :pointer
74
+ attach_function :TTF_RenderUNICODE_Solid, [:pointer, :pointer, :ulong] , :pointer
75
+ attach_function :TTF_RenderGlyph_Solid, [:pointer, :ushort, :ulong] , :pointer
76
+ attach_function :TTF_RenderText_Shaded, [:pointer, :string, :ulong, :ulong], :pointer
77
+ attach_function :TTF_RenderUTF8_Shaded, [:pointer, :string, :ulong, :ulong], :pointer
78
+ attach_function :TTF_RenderUNICODE_Shaded, [:pointer, :pointer, :ulong, :ulong], :pointer
79
+ attach_function :TTF_RenderGlyph_Shaded, [:pointer, :ushort, :ulong, :ulong] , :pointer
80
+ attach_function :TTF_RenderText_Blended, [:pointer, :string, :ulong] , :pointer
81
+ attach_function :TTF_RenderUTF8_Blended, [:pointer, :string, :ulong] , :pointer
82
+ attach_function :TTF_RenderUNICODE_Blended, [:pointer, :pointer, :ulong] , :pointer
83
+ attach_function :TTF_RenderGlyph_Blended, [:pointer, :ushort, :ulong] , :pointer
84
+
85
+ # Close an opened font file
86
+ attach_function :TTF_CloseFont, [:pointer], :void
87
+ # De-initialize the TTF engine
88
+ attach_function :TTF_Quit , [], :void
89
+ # Check if SDL_TTF was initialized.
90
+ attach_function :TTF_WasInit , [], :int
91
+ end
92
+
93
+ end
94
+ end
95
+
data/lib/frusdl/sdl.rb ADDED
@@ -0,0 +1,425 @@
1
+ module Frusdl
2
+ module SDL
3
+ extend Frusdl::Low::SDL
4
+ include Frusdl::Low::SDL
5
+
6
+ class Error < Exception
7
+ end
8
+
9
+
10
+ INIT_TIMER = SDL_INIT_TIMER
11
+ INIT_AUDIO = SDL_INIT_AUDIO
12
+ INIT_VIDEO = SDL_INIT_VIDEO
13
+ INIT_CDROM = SDL_INIT_CDROM
14
+ INIT_JOYSTICK = SDL_INIT_JOYSTICK
15
+ INIT_NOPARACHUTE = SDL_INIT_NOPARACHUTE
16
+ INIT_EVENTTHREAD = SDL_INIT_EVENTTHREAD
17
+ INIT_EVERYTHING = SDL_INIT_EVERYTHING
18
+
19
+ # Helper function to raise an error message from SDL_GetError .
20
+ def raise_error()
21
+ message = SDL_GetError();
22
+ raise SDL::Error.new(message)
23
+ end
24
+
25
+ # Initializes SDL. This should be called before all other Frusdl methods.
26
+ # The flags parameter specifies what part(s) of SDL to initialize.
27
+ # SDL::INIT_AUDIO : Initialize audio subsystems.
28
+ # SDL::INIT_VIDEO : Initialize SDL::Video subsystem.
29
+ # SDL::INIT_CDROM : Initialize SDL::CDROM subsystem.
30
+ # SDL::INIT_JOYSTICK : Initialize SDL::Joystick subsystem.
31
+ # SDL::INIT_EVERYTHING : Initialize all of the above.
32
+ # Raises SDL::Error on failure
33
+ def self.init(what= INIT_EVERYTHING)
34
+ res = SDL_Init(what)
35
+ raise_error if res < 0
36
+ at_exit { SDL_Quit() }
37
+ end
38
+
39
+ # This method shuts down all SDL subsystems and frees the resources
40
+ # allocated to them. This method is automatically called when ruby stops,
41
+ # so normally you don't have to call this function.
42
+ def self.quit()
43
+ SDL_Quit()
44
+ end
45
+
46
+ # This method allows you to see which SDL subsytems have
47
+ # been initialized. flags is a bitwise OR'd combination of the subsystems
48
+ # you wish to check (see SDL.init for a list of subsystem flags).
49
+ # Returns a bitwised OR'd combination of the initialized subsystems.
50
+ def self.inited_system(flags)
51
+ return SDL_WasInit(flags)
52
+ end
53
+
54
+
55
+ def self.getenv(s)
56
+ return SDL_getenv(s)
57
+ end
58
+
59
+ def self.putenv(s)
60
+ return SDL_putenv(s)
61
+ end
62
+
63
+
64
+
65
+ # And some for video functions
66
+ SDL_SWSURFACE = 0x00000000
67
+ SDL_HWSURFACE = 0x00000001
68
+ SDL_ASYNCBLIT = 0x00000004
69
+ SDL_ANYFORMAT = 0x10000000
70
+ SDL_HWPALETTE = 0x20000000
71
+ SDL_DOUBLEBUF = 0x40000000
72
+ SDL_FULLSCREEN = 0x80000000
73
+ SDL_OPENGL = 0x00000002
74
+ SDL_OPENGLBLIT = 0x0000000A
75
+ SDL_RESIZABLE = 0x00000010
76
+ SDL_NOFRAME = 0x00000020
77
+ # And some more for mouse grabbing
78
+ SDL_GRAB_QUERY = -1
79
+ SDL_GRAB_OFF = 0
80
+ SDL_GRAB_ON = 1
81
+ SDL_GRAB_FULLSCREEN = 2
82
+
83
+ SDL_LIL_ENDIAN = :little_endian
84
+
85
+ if [-1].pack('V') == [-1].pack('N')
86
+ SDL_BYTEORDER = SDL_LIL_ENDIAN
87
+ else
88
+ SDL_BYTEORDER = SDL_BIG_ENDIAN
89
+ end
90
+
91
+ AUDIO_U8 = 0x0008 # Unsigned 8-bit samples
92
+ AUDIO_S8 = 0x8008 # Signed 8-bit samples
93
+ AUDIO_U16LSB = 0x0010 # Unsigned 16-bit samples
94
+ AUDIO_S16LSB = 0x8010 # Signed 16-bit samples
95
+ AUDIO_U16MSB = 0x1010 # As above, but big-endian byte order
96
+ AUDIO_S16MSB = 0x9010 # As above, but big-endian byte order
97
+ AUDIO_U16 = AUDIO_U16LSB
98
+ AUDIO_S16 = AUDIO_S16LSB
99
+
100
+ # Native audio byte ordering
101
+ if SDL_BYTEORDER == SDL_LIL_ENDIAN
102
+ AUDIO_U16SYS = AUDIO_U16LSB
103
+ AUDIO_S16SYS = AUDIO_S16LSB
104
+ else
105
+ AUDIO_U16SYS = AUDIO_U16MSB
106
+ AUDIO_S16SYS = AUDIO_S16MSB
107
+ end
108
+
109
+ SDL_AUDIO_STOPPED = 0
110
+ SDL_AUDIO_PLAYING = 1
111
+ SDL_AUDIO_PAUSED = 2
112
+ SDL_MIX_MAXVOLUME = 128
113
+
114
+ SDL_DEFAULT_REPEAT_DELAY = 500
115
+ SDL_DEFAULT_REPEAT_INTERVAL = 30
116
+
117
+ # SDL_keysym (lots of boring constants ahead :p )
118
+ SDLK_UNKNOWN = 0
119
+ SDLK_FIRST = 0
120
+ SDLK_BACKSPACE = 8
121
+ SDLK_TAB = 9
122
+ SDLK_CLEAR = 12
123
+ SDLK_RETURN = 13
124
+ SDLK_PAUSE = 19
125
+ SDLK_ESCAPE = 27
126
+ SDLK_SPACE = 32
127
+ SDLK_EXCLAIM = 33
128
+ SDLK_QUOTEDBL = 34
129
+ SDLK_HASH = 35
130
+ SDLK_DOLLAR = 36
131
+ SDLK_AMPERSAND = 38
132
+ SDLK_QUOTE = 39
133
+ SDLK_LEFTPAREN = 40
134
+ SDLK_RIGHTPAREN = 41
135
+ SDLK_ASTERISK = 42
136
+ SDLK_PLUS = 43
137
+ SDLK_COMMA = 44
138
+ SDLK_MINUS = 45
139
+ SDLK_PERIOD = 46
140
+ SDLK_SLASH = 47
141
+ SDLK_0 = 48
142
+ SDLK_1 = 49
143
+ SDLK_2 = 50
144
+ SDLK_3 = 51
145
+ SDLK_4 = 52
146
+ SDLK_5 = 53
147
+ SDLK_6 = 54
148
+ SDLK_7 = 55
149
+ SDLK_8 = 56
150
+ SDLK_9 = 57
151
+ SDLK_COLON = 58
152
+ SDLK_SEMICOLON = 59
153
+ SDLK_LESS = 60
154
+ SDLK_EQUALS = 61
155
+ SDLK_GREATER = 62
156
+ SDLK_QUESTION = 63
157
+ SDLK_AT = 64
158
+ SDLK_LEFTBRACKET = 91
159
+ SDLK_BACKSLASH = 92
160
+ SDLK_RIGHTBRACKET = 93
161
+ SDLK_CARET = 94
162
+ SDLK_UNDERSCORE = 95
163
+ SDLK_BACKQUOTE = 96
164
+ SDLK_a = 97
165
+ SDLK_b = 98
166
+ SDLK_c = 99
167
+ SDLK_d = 100
168
+ SDLK_e = 101
169
+ SDLK_f = 102
170
+ SDLK_g = 103
171
+ SDLK_h = 104
172
+ SDLK_i = 105
173
+ SDLK_j = 106
174
+ SDLK_k = 107
175
+ SDLK_l = 108
176
+ SDLK_m = 109
177
+ SDLK_n = 110
178
+ SDLK_o = 111
179
+ SDLK_p = 112
180
+ SDLK_q = 113
181
+ SDLK_r = 114
182
+ SDLK_s = 115
183
+ SDLK_t = 116
184
+ SDLK_u = 117
185
+ SDLK_v = 118
186
+ SDLK_w = 119
187
+ SDLK_x = 120
188
+ SDLK_y = 121
189
+ SDLK_z = 122
190
+ SDLK_DELETE = 127
191
+ SDLK_WORLD_0 = 160
192
+ SDLK_WORLD_1 = 161
193
+ SDLK_WORLD_2 = 162
194
+ SDLK_WORLD_3 = 163
195
+ SDLK_WORLD_4 = 164
196
+ SDLK_WORLD_5 = 165
197
+ SDLK_WORLD_6 = 166
198
+ SDLK_WORLD_7 = 167
199
+ SDLK_WORLD_8 = 168
200
+ SDLK_WORLD_9 = 169
201
+ SDLK_WORLD_10 = 170
202
+ SDLK_WORLD_11 = 171
203
+ SDLK_WORLD_12 = 172
204
+ SDLK_WORLD_13 = 173
205
+ SDLK_WORLD_14 = 174
206
+ SDLK_WORLD_15 = 175
207
+ SDLK_WORLD_16 = 176
208
+ SDLK_WORLD_17 = 177
209
+ SDLK_WORLD_18 = 178
210
+ SDLK_WORLD_19 = 179
211
+ SDLK_WORLD_20 = 180
212
+ SDLK_WORLD_21 = 181
213
+ SDLK_WORLD_22 = 182
214
+ SDLK_WORLD_23 = 183
215
+ SDLK_WORLD_24 = 184
216
+ SDLK_WORLD_25 = 185
217
+ SDLK_WORLD_26 = 186
218
+ SDLK_WORLD_27 = 187
219
+ SDLK_WORLD_28 = 188
220
+ SDLK_WORLD_29 = 189
221
+ SDLK_WORLD_30 = 190
222
+ SDLK_WORLD_31 = 191
223
+ SDLK_WORLD_32 = 192
224
+ SDLK_WORLD_33 = 193
225
+ SDLK_WORLD_34 = 194
226
+ SDLK_WORLD_35 = 195
227
+ SDLK_WORLD_36 = 196
228
+ SDLK_WORLD_37 = 197
229
+ SDLK_WORLD_38 = 198
230
+ SDLK_WORLD_39 = 199
231
+ SDLK_WORLD_40 = 200
232
+ SDLK_WORLD_41 = 201
233
+ SDLK_WORLD_42 = 202
234
+ SDLK_WORLD_43 = 203
235
+ SDLK_WORLD_44 = 204
236
+ SDLK_WORLD_45 = 205
237
+ SDLK_WORLD_46 = 206
238
+ SDLK_WORLD_47 = 207
239
+ SDLK_WORLD_48 = 208
240
+ SDLK_WORLD_49 = 209
241
+ SDLK_WORLD_50 = 210
242
+ SDLK_WORLD_51 = 211
243
+ SDLK_WORLD_52 = 212
244
+ SDLK_WORLD_53 = 213
245
+ SDLK_WORLD_54 = 214
246
+ SDLK_WORLD_55 = 215
247
+ SDLK_WORLD_56 = 216
248
+ SDLK_WORLD_57 = 217
249
+ SDLK_WORLD_58 = 218
250
+ SDLK_WORLD_59 = 219
251
+ SDLK_WORLD_60 = 220
252
+ SDLK_WORLD_61 = 221
253
+ SDLK_WORLD_62 = 222
254
+ SDLK_WORLD_63 = 223
255
+ SDLK_WORLD_64 = 224
256
+ SDLK_WORLD_65 = 225
257
+ SDLK_WORLD_66 = 226
258
+ SDLK_WORLD_67 = 227
259
+ SDLK_WORLD_68 = 228
260
+ SDLK_WORLD_69 = 229
261
+ SDLK_WORLD_70 = 230
262
+ SDLK_WORLD_71 = 231
263
+ SDLK_WORLD_72 = 232
264
+ SDLK_WORLD_73 = 233
265
+ SDLK_WORLD_74 = 234
266
+ SDLK_WORLD_75 = 235
267
+ SDLK_WORLD_76 = 236
268
+ SDLK_WORLD_77 = 237
269
+ SDLK_WORLD_78 = 238
270
+ SDLK_WORLD_79 = 239
271
+ SDLK_WORLD_80 = 240
272
+ SDLK_WORLD_81 = 241
273
+ SDLK_WORLD_82 = 242
274
+ SDLK_WORLD_83 = 243
275
+ SDLK_WORLD_84 = 244
276
+ SDLK_WORLD_85 = 245
277
+ SDLK_WORLD_86 = 246
278
+ SDLK_WORLD_87 = 247
279
+ SDLK_WORLD_88 = 248
280
+ SDLK_WORLD_89 = 249
281
+ SDLK_WORLD_90 = 250
282
+ SDLK_WORLD_91 = 251
283
+ SDLK_WORLD_92 = 252
284
+ SDLK_WORLD_93 = 253
285
+ SDLK_WORLD_94 = 254
286
+ SDLK_WORLD_95 = 255
287
+ SDLK_KP0 = 256
288
+ SDLK_KP1 = 257
289
+ SDLK_KP2 = 258
290
+ SDLK_KP3 = 259
291
+ SDLK_KP4 = 260
292
+ SDLK_KP5 = 261
293
+ SDLK_KP6 = 262
294
+ SDLK_KP7 = 263
295
+ SDLK_KP8 = 264
296
+ SDLK_KP9 = 265
297
+ SDLK_KP_PERIOD = 266
298
+ SDLK_KP_DIVIDE = 267
299
+ SDLK_KP_MULTIPLY = 268
300
+ SDLK_KP_MINUS = 269
301
+ SDLK_KP_PLUS = 270
302
+ SDLK_KP_ENTER = 271
303
+ SDLK_KP_EQUALS = 272
304
+ SDLK_UP = 273
305
+ SDLK_DOWN = 274
306
+ SDLK_RIGHT = 275
307
+ SDLK_LEFT = 276
308
+ SDLK_INSERT = 277
309
+ SDLK_HOME = 278
310
+ SDLK_END = 279
311
+ SDLK_PAGEUP = 280
312
+ SDLK_PAGEDOWN = 281
313
+ SDLK_F1 = 282
314
+ SDLK_F2 = 283
315
+ SDLK_F3 = 284
316
+ SDLK_F4 = 285
317
+ SDLK_F5 = 286
318
+ SDLK_F6 = 287
319
+ SDLK_F7 = 288
320
+ SDLK_F8 = 289
321
+ SDLK_F9 = 290
322
+ SDLK_F10 = 291
323
+ SDLK_F11 = 292
324
+ SDLK_F12 = 293
325
+ SDLK_F13 = 294
326
+ SDLK_F14 = 295
327
+ SDLK_F15 = 296
328
+ SDLK_NUMLOCK = 300
329
+ SDLK_CAPSLOCK = 301
330
+ SDLK_SCROLLOCK = 302
331
+ SDLK_RSHIFT = 303
332
+ SDLK_LSHIFT = 304
333
+ SDLK_RCTRL = 305
334
+ SDLK_LCTRL = 306
335
+ SDLK_RALT = 307
336
+ SDLK_LALT = 308
337
+ SDLK_RMETA = 309
338
+ SDLK_LMETA = 310
339
+ SDLK_LSUPER = 311
340
+ SDLK_RSUPER = 312
341
+ SDLK_MODE = 313
342
+ SDLK_COMPOSE = 314
343
+ SDLK_HELP = 315
344
+ SDLK_PRINT = 316
345
+ SDLK_SYSREQ = 317
346
+ SDLK_BREAK = 318
347
+ SDLK_MENU = 319
348
+ SDLK_POWER = 320
349
+ SDLK_EURO = 321
350
+ SDLK_UNDO = 322
351
+ SDLK_LAST = 323
352
+
353
+ KMOD_NONE = 0x0000
354
+ KMOD_LSHIFT = 0x0001
355
+ KMOD_RSHIFT = 0x0002
356
+ KMOD_LCTRL = 0x0040
357
+ KMOD_RCTRL = 0x0080
358
+ KMOD_LALT = 0x0100
359
+ KMOD_RALT = 0x0200
360
+ KMOD_LMETA = 0x0400
361
+ KMOD_RMETA = 0x0800
362
+ KMOD_NUM = 0x1000
363
+ KMOD_CAPS = 0x2000
364
+ KMOD_MODE = 0x4000
365
+ KMOD_RESERVED = 0x8000
366
+ KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL)
367
+ KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT)
368
+ KMOD_ALT = (KMOD_LALT|KMOD_RALT)
369
+ KMOD_META = (KMOD_LMETA|KMOD_RMETA)
370
+ # Phew, all done! ^_^
371
+
372
+ RW_SEEK_SET = 0
373
+ RW_SEEK_CUR = 1
374
+ RW_SEEK_END = 2
375
+
376
+ # SDL_event
377
+ SDL_RELEASED = 0
378
+ SDL_PRESSED = 1
379
+ SDL_NOEVENT = 0
380
+ SDL_ACTIVEEVENT = 1
381
+ SDL_KEYDOWN = 2
382
+ SDL_KEYUP = 3
383
+ SDL_MOUSEMOTION = 4
384
+ SDL_MOUSEBUTTONDOWN = 5
385
+ SDL_MOUSEBUTTONUP = 6
386
+ SDL_JOYAXISMOTION = 7
387
+ SDL_JOYBALLMOTION = 8
388
+ SDL_JOYHATMOTION = 9
389
+ SDL_JOYBUTTONDOWN = 10
390
+ SDL_JOYBUTTONUP = 11
391
+ SDL_QUIT = 12
392
+ SDL_SYSWMEVENT = 13
393
+ SDL_EVENT_RESERVEDA = 14
394
+ SDL_EVENT_RESERVEDB = 15
395
+ SDL_VIDEORESIZE = 16
396
+ SDL_VIDEOEXPOSE = 17
397
+ SDL_EVENT_RESERVED2 = 18
398
+ SDL_EVENT_RESERVED3 = 19
399
+ SDL_EVENT_RESERVED4 = 20
400
+ SDL_EVENT_RESERVED5 = 21
401
+ SDL_EVENT_RESERVED6 = 22
402
+ SDL_EVENT_RESERVED7 = 23
403
+ SDL_USEREVENT = 24
404
+ SDL_NUMEVENTS = 32
405
+
406
+ SDL_HAT_CENTERED = 0x00
407
+ SDL_HAT_UP = 0x01
408
+ SDL_HAT_RIGHT = 0x02
409
+ SDL_HAT_DOWN = 0x04
410
+ SDL_HAT_LEFT = 0x08
411
+ SDL_HAT_RIGHTUP = (SDL_HAT_RIGHT|SDL_HAT_UP)
412
+ SDL_HAT_RIGHTDOWN = (SDL_HAT_RIGHT|SDL_HAT_DOWN)
413
+ SDL_HAT_LEFTUP = (SDL_HAT_LEFT|SDL_HAT_UP)
414
+ SDL_HAT_LEFTDOWN = (SDL_HAT_LEFT|SDL_HAT_DOWN)
415
+
416
+
417
+
418
+
419
+ autoload :Surface , 'frusdl/sdl/surface'
420
+ autoload :Screen , 'frusdl/sdl/screen'
421
+ autoload :PixelFormat , 'frusdl/sdl/pixelformat'
422
+ autoload :VideoInfo , 'frusdl/sdl/videoinfo'
423
+
424
+ end # module SDL
425
+ end # module Frusdl