source: project/wiki/eggref/4/sdl-base @ 29288

Last change on this file since 29288 was 29288, checked in by svnwiki, 7 years ago

Anonymous wiki edit for IP [83.59.3.26]: Reassure the reader that the timer handling of sdl-base doesn't mess with threads (concerns about this is why I looked at the sources in first place.)

File size: 23.6 KB
Line 
1[[tags: egg]]
2
3== sdl-base
4
5The '''sdl-base''' egg is a successor to the [[sdl]] egg (the latter is expected to become deprecated in the future).
6
7[[toc:]]
8
9Unlike '''sdl''', '''sdl-base''' has only the binding for the basic SDL library. This allows for a fine-grained control over what gets linked with your program. For bindings to the complementary libraries see their respective eggs: [[sdl-img]] for SDL_Image, [[sdl-mixer]] for SDL_Mixer and [[sdl-ttf]] for SDL_TTF.
10
11=== Naming conventions
12
13The '''sdl-base''' egg uses roughtly the same naming conventions as the '''sdl''' egg and as the [[http://www.nongnu.org/guile-sdl/|guile-sdl]]: {{SDL_}} prefix is replaced with {{sdl-}}, and hyphens are used to separate words instead of camel-case.
14
15
16=== Procedures
17
18==== Related to sdl-version
19
20{{sdl-version}} is a structure for holding the version of the SDL library. This is a wrapper for [[http://wiki.libsdl.org/moin.cgi/SDL_version|SDL_version]] structure in the C library. SDL_version consists of 3 fields: major version number, minor version number and patch number. You don’t usually need to create new instances of this structure: you obtain the version of SDL program was compiled with or linked with, and then get individual fields or check if the version is not too old with ``sdl-version-at-least``.
21
22<procedure>(make-sdl-version pointer)</procedure>
23Creates a new wrapper over the C’s SDL_version structure. Usually you won’t need to use this function directly. Instead, use {{(sdl-compiled-version)}} and {{(sdl-linked-version)}} to obtain the version information.
24
25<procedure>(sdl-version-major sdl-version)</procedure>
26Evaluates to the major version number for an SDL version in question.
27
28<procedure>(sdl-version-minor sdl-version)</procedure>
29Evaluates to the minor version number for an SDL version in question.
30
31<procedure>(sdl-version-patch sdl-version)</procedure>
32Evaluates to the patch number for an SDL version in question.
33
34<procedure>(sdl-version-at-least  sdl-version major minor patch)</procedure>
35Convenient function to check all the three components at once: evaluates to {{#t}} if the version is newer or equal to the version denoted by the {{major}}, {{minor}} and {{patch}} arguments, or to {{#f}} otherwise. This is analogous to the [[http://wiki.libsdl.org/moin.cgi/SDL_VERSION_ATLEAST|SDL_VERSION_ATLEAST]] in the C interface.
36
37<procedure>(sdl-compiled-version)</procedure>
38Returns the {{sdl-version}} structure describing the SDL version number of the SDL library used during the compilation. This is analogous to the [[http://wiki.libsdl.org/moin.cgi/SDL_COMPILEDVERSION|SDL_COMPILEDVERSION]] macro in the C interface.
39
40<procedure>(sdl-linked-version)</procedure>
41Returns the {{sdl-version}} structure describing the SDL version number of the SDL library used the program is linked against. This is analogous to the [[http://wiki.libsdl.org/moin.cgi/SDL_VERSION|SDL_VERSION]] macro in the C interface.
42
43
44==== Related to sdl-rect
45
46{{sdl-rect}} is a structure for describing a rectangle. It is widely used in the SDL library. It has two fields, {{x}} and {{y}}, denoting its position and two fields, {{w}} and {{h}} denoting width and height respectively. All the values are integers and measured in pixels.
47
48<procedure>(make-sdl-rect x y w h)</procedure>
49Creates a new {{sdl-rect}} structure with the values given in the arguments.
50
51<procedure>(sdl-rect-buffer sdl-rect)</procedure>
52??? TODO
53
54<procedure>(sdl-rect? obj)</procedure>
55Evaluates to {{#t}} if {{obj}} is {{sdl-rect}}, or {{#f}} otherwise.
56
57<procedure>(sdl-rect-x sdl-rect)</procedure>
58Evaluates to the horizontal position of the leftmost part of a given {{sdl-rect}} in pixels.
59
60<procedure>(sdl-rect-y sdl-rect)</procedure>
61Evaluates to the vertical position of the topmost part a given {{sdl-rect}} in pixels. Like in many programming libraries, in SDL the {{y}} axis runs from top to bottom.
62
63<procedure>(sdl-rect-w sdl-rect)</procedure>
64Evaluates to the width of a given {{sdl-rect}} in pixels.
65
66<procedure>(sdl-rect-h sdl-rect)</procedure>
67Evaluates to the height of a given {{sdl-rect}} in pixels.
68
69==== Related to sdl-pixel-format
70
71The {{sdl-pixel-format}} structure describes the way pixels are stored in the surface. It is a wrapper for the [[http://wiki.libsdl.org/moin.cgi/SDL_PixelFormat|SDL_PixelFormat]] structure in SDL’s C interface.
72
73Currently the {{sdl}} egg exposes no function to work with the SDL_Palette structure.
74
75<procedure>(make-sdl-pixel-format pointer)</procedure>
76Creates a new wrapper over the C’s {{SDL_PixelFormat}} structure. Usually you won’t need to use this function directly.
77
78<procedure>(sdl-pixel-format? obj)</procedure>
79Evaluates to {{#t}} if {{obj}} is {{sdl-pixel-format}}, or to {{#f}} otherwise.
80
81<procedure>(sdl-pixel-format-bytes-per-pixel sdl-rect)</procedure>
82Evaluates to the number of bytes used to store one pixel in a given {{sdl-pixel-format}}. The result is always an integer value.
83
84<procedure>(sdl-pixel-format-rmask sdl-rect)</procedure>
85Evaluates to the ''red mask'', 32-bit integer number describing the way red-colour component is stored in a given {{sdl-pixel-format}}. The result is always an integer value. The red mask is an integer value in which the bits set to 1 represent bits used to store the red value. Red mask is not used for 8-bit (1-byte) pixel formats.
86
87
88<procedure>(sdl-pixel-format-gmask sdl-rect)</procedure>
89Evaluates to the ''green mask'', 32-bit integer value. Green mask is not used for 8-bit (1-byte) pixel formats.
90
91<procedure>(sdl-pixel-format-bmask sdl-rect)</procedure>
92Evaluates to the ''blue mask'', 32-bit integer value. Blue mask is not used for 8-bit (1-byte) pixel formats.
93
94<procedure>(sdl-pixel-format-amask sdl-rect)</procedure>
95Evaluates to the ''alpha mask'', 32-bit integer value. Alpha mask is not used for 8-bit (1-byte) pixel formats.
96
97==== Related to sdl-surface
98
99The {{sdl_surface}} structure represents the object used to store image data. It is characterised by width ({{w}}), height ({{h}}), pixel format ({{pixel-format}}), {{flags}} describing additional information, the actual pixel values ({{pixels}}) and some other information. It is a wrapper over [[http://wiki.libsdl.org/moin.cgi/SDL_Surface|SDL_Surface]] structure in SDL’s C interface.
100
101Unlike most other objects, surfaces '''must be explicitly disposed of after using''' with the {{sdl-free-surface}} function.
102
103<procedure>(make-sdl-surface pointer)</procedure>
104Creates a new wrapper over the C’s {{SDL_PixelFormat}} structure. Usually you won’t need to use this function directly, its main purpose is interoperability with foreign C code. To create new empty surfaces, use the {{sdl-create-rgb-surface}} function. To create surface from files, use
105
106<procedure>(sdl-surface? obj)</procedure>
107Evaluates to {{#t}} if {{obj}} is {{sdl-surface}}, or to {{#f}} otherwise.
108
109<procedure>(sdl-create-rgb-surface flags width height depth rmask gmask bmask amask)</procedure>
110Creates a RGB(A) surface with the given height, width, rmask, gmask, bmask and amask. This is a wrapper for [[http://wiki.libsdl.org/moin.cgi/SDL_CreateRGBSurface|SDL_CreateRGBSurface]] function.
111
112Flags can be: {{SDL_SWSURFACE}} (store surface in general-purpose memory) or {{SDL_HWSURFACE}} (store surface in video memory), {{SDL_SRCCOLORKEY}} (turn on colour-keying; use {{sdl-set-color-key!}} to change the value of this flag after surface creation), {{SDL_SRCALPHA}} (use alpha-channel for surface; this flag is automatically set if {{amask}} is non-zero; {{sdl-set-alpha!}} allows to change this flag later). Flags can be combined with {{+}}.
113
114<procedure>(sdl-surface-flags sdl-surface)</procedure>
115Evaluates to flags describing the given surface.
116
117<procedure>(sdl-surface-pixel-format sdl-surface)</procedure>
118Evaluates to pixel format describing the given surface.
119
120<procedure>(sdl-surface-width sdl-surface)</procedure>
121Evaluates to the width of a given surface.
122
123<procedure>(sdl-surface-height sdl-surface)</procedure>
124Evaluates to the height of a given surface.
125
126<procedure>(sdl-surface-pitch sdl-surface)</procedure>
127Evaluates to the actual number of bytes describing each row of a given surface.
128
129<procedure>(sdl-surface-pixels sdl-surface)</procedure>
130Evaluates to the pixel data (TODO: ??? how is it mapped to Scheme objects???) a given surface.
131
132<procedure>(sdl-surface-pixels-length sdl-surface)</procedure>
133Evaluates to the size of pixel data in bytes.
134
135<procedure>(sdl-free-surface sdl-surface)</procedure>
136Disposes of the unused surface. Surface should not be used after calling this function. Failing to call this function on used surfaces may result in memory leaks.
137
138==== Related to sdl-video-info
139
140{{sdl-video-info}} is a read-only structure that contains information on the video mode. It is returned by {{sdl-get-video-info}} and cointains information either on the best available video mode (if called before {{sdl-set-video-mode}}) or on the current video mode.
141
142<procedure>(make-sdl-video-info pointer)</procedure>
143Creates a new Scheme structure from the C’s structure. This function is usually not neccessary in Scheme programs: just use {{sdl-get-video-mode}} directly instead of calling it from C code.
144
145<procedure>(sdl-video-info-pointer)</procedure>
146???? TODO
147
148<procedure>(sdl-get-video-info)</procedure>
149Returns a {{sdl-video-info}} structure describing either the 'best' video mode (if called before {{sdl-set-video-mode}}) or the current video mode.
150
151<procedure>(sdl-video-info-hw-available sdl-video-info)</procedure>
152Evaluates to {{1}} if it is possible to create hardware-accelerated surfaces according to the data in the {{sdl-video-info}}, to {{0}} otherwise.
153
154<procedure>(sdl-video-info-wm-available sdl-video-info)</procedure>
155Evaluates to {{1}} if the window manager is available according to the data in the {{sdl-video-info}}, to {{0}} otherwise.
156
157<procedure>(sdl-video-info-blit-hw sdl-video-info)</procedure>
158Evaluates to {{1} if blits from hardware memory to hardware memory are hardware-accelerated, according to the data in the {{sdl-video-info}}, {{0}} otherwise.
159
160<procedure>(sdl-video-info-blit-hw-cc sdl-video-info)</procedure>
161Evaluates to {{1}} its from hardware memory to hardware memory with colour key are hardware-accelerated, according to the data in the {{sdl-video-info}}, {{0}} otherwise.
162
163<procedure>(sdl-video-info-blit-hw-a sdl-video-info)</procedure>
164Evaluates to {{1}} its from hardware memory to hardware memory with alpha channel are hardware-accelerated, according to the data in the {{sdl-video-info}}, to {{0}} otherwise.
165
166<procedure>(sdl-video-info-blit-sw sdl-video-info)</procedure>
167Evaluates to {{1}} if blits from software memory to hardware memory are hardware-accelerated, according to the data in the {{sdl-video-info}}, {{0}} otherwise.
168
169<procedure>(sdl-video-info-blit-sw-cc sdl-video-info)</procedure>
170Evaluates to {{1}} if blits from software memory to hardware memory with colour key are hardware-accelerated, according to the data in the {{sdl-video-info}}, {{0}} otherwise.
171
172<procedure>(sdl-video-info-blit-sw-a sdl-video-info)</procedure>
173Evaluates to {{1}} if blits from software memory to hardware memory with alpha channel are hardware-accelerated, according to the data in the {{sdl-video-info}}, {{0}} otherwise.
174
175<procedure>(sdl-video-info-blit-fill sdl-video-info)</procedure>
176Evaluates to {{1}} if colour fills are hardware-accelerated, according to the data in the {{sdl-video-info}}, or to {{0}} otherwise.
177
178<procedure>(sdl-video-info-video-mem sdl-video-info)</procedure>
179Evaluates to an integer representing the total amount of video memory in kilobytes, according to {{sdl-video-info}}.
180
181<procedure>(sdl-video-info-vfmt sdl-video-info)</procedure>
182Evaluates to {{sdl-pixel-format}} structure describing the pixel format of the video mode described by {{sdl-video-info}}.
183
184<procedure>(sdl-video-info-current-w sdl-video-info)</procedure>
185Evaluates to the width, in pixels, of the video mode described by {{sdl-video-info}}.
186
187<procedure>(sdl-video-info-current-h sdl-video-info)</procedure>
188Evaluates to the height, in pixels, of the video mode described by {{sdl-video-info}}.
189
190==== Related to sdl-color
191{{sdl-color}} structure describes a colour in a format-independent way. It has 3 fields, {{r}}, {{g}} and {{b}} describing the red, green and blue components of colour according to the RGB model respectively. Corresponds to {{SDL_Color}} structure in C API.
192
193<procedure>(make-sdl-color r g b)</procedure>
194Accepts the reg, green and blue components of colour respectively and return a new {{sdl-color}} value.
195
196<procedure>(sdl-color-buffer sdl-color)</procedure>
197??? TODO
198
199<procedure>(sdl-color? obj)</procedure>
200Evaluates to {{#t}} if {{obj}} is of type {{sdl-color}}, or to {{#f}} otherwise.
201
202<procedure>(sdl-color-r sdl-color)</procedure>
203Returns the red component of the colour denoted by its argument.
204
205<procedure>(sdl-color-g sdl-color)</procedure>
206Returns the green component of the colour denoted by its argument.
207
208<procedure>(sdl-color-b sdl-color)</procedure>
209Returns the blue component of the colour denoted by its argument.
210
211
212==== Related to sdl-event (TODO)
213{{sdl-event}} is a structure describing the events that occur in an SDL program. These can be of different types, and different fields are applicable for different types. To get the type of event, use {{sdl-event-type}} procedure. This structure corresponds to {{SDL_Event}} in C API.
214
215<procedure>(make-sdl-event)</procedure>
216Returns a new {{sdl-event}} structure.
217
218<procedure>(sdl-event-buffer sdl-event-buffer-set! ...)</procedure>
219TODO ????
220
221<procedure>(sdl-event-type sdl-event)</procedure>
222Returns an integer number denoting the type of event. This number will be equal to one of the following constants:
223* {{SDL_ACTIVEEVENT}} (activation event; occurs when application has gained or recieved focus; {{gain}} and {{state}} fields are applicable),
224* {{SDL_KEYDOWN}} and {{SDL_KEYUP}} (keypress event; occurs when a key has been pressed or released; {{state}}, {{sym}}, {{mod}}, {{scancode}} and {{unicode}} fields are available),
225* {{SDL_MOUSEMOTION}}, {{SDL_MOUSEBUTTONDOWN}} and {{SDL_MOUSEBUTTONUP}} (occurs when mouse is moved or mouse button in clicked or released; {{state}}, {{x}}, {{y}}, {{xrel}} and {{yrel}} fields are available),
226* {{SDL_JOYAXISMOTION}},
227* {{SDL_JOYBALLMOTION}},
228* {{SDL_JOYHATMOTION}},
229* {{SDL_JOYBUTTONDOWN}} and {{SDL_JOYBUTTONUP}},
230* {{SDL_QUIT}},
231* {{SDL_SYSWMEVENT}},
232* {{SDL_VIDEORESIZE}},
233* {{SDL_VIDEOEXPOSE}},
234* {{SDL_USEREVENT}} or higher.
235
236<procedure>(sdl-event? ...)</procedure>
237<procedure>(sdl-event-gain ...)</procedure>
238<procedure>(set-sdl-event-gain! ...)</procedure>
239<procedure>(sdl-event-which ...)</procedure>
240<procedure>(set-sdl-event-which! ...)</procedure>
241<procedure>(sdl-event-state ...)</procedure>
242<procedure>(set-sdl-event-state! ...)</procedure>
243<procedure>(sdl-event-scancode ...)</procedure>
244<procedure>(set-sdl-event-scancode! ...)</procedure>
245<procedure>(sdl-event-sym ...)</procedure>
246<procedure>(set-sdl-event-sym! ...)</procedure>
247<procedure>(sdl-event-mod ...)</procedure>
248<procedure>(set-sdl-event-mod! ...)</procedure>
249<procedure>(sdl-event-unicode ...)</procedure>
250<procedure>(set-sdl-event-unicode! ...)</procedure>
251<procedure>(sdl-event-x ...)</procedure>
252<procedure>(set-sdl-event-x! ...)</procedure>
253<procedure>(sdl-event-y ...)</procedure>
254<procedure>(set-sdl-event-y! ...)</procedure>
255<procedure>(sdl-event-xrel ...)</procedure>
256<procedure>(set-sdl-event-xrel! ...)</procedure>
257<procedure>(sdl-event-yrel ...)</procedure>
258<procedure>(set-sdl-event-yrel! ...)</procedure>
259<procedure>(sdl-event-axis ...)</procedure>
260<procedure>(set-sdl-event-axis! ...)</procedure>
261<procedure>(sdl-event-ball ...)</procedure>
262<procedure>(set-sdl-event-ball! ...)</procedure>
263<procedure>(sdl-event-hat ...)</procedure>
264<procedure>(set-sdl-event-hat! ...)</procedure>
265<procedure>(sdl-event-value ...)</procedure>
266<procedure>(set-sdl-event-value! ...)</procedure>
267<procedure>(sdl-event-button ...)</procedure>
268<procedure>(set-sdl-event-button! ...)</procedure>
269<procedure>(sdl-event-w ...)</procedure>
270<procedure>(set-sdl-event-w! ...)</procedure>
271<procedure>(sdl-event-h ...)</procedure>
272<procedure>(set-sdl-event-h! ...)</procedure>
273
274==== TODO: undocumented functions
275<procedure>(sdl-get-clip-rect! sdl-surface sdl-rect)</procedure>
276Retrieves the clipping rectangle for the surface ({{sdl-surface}}) and saves it into the object {{sdl-rect}}. When something is blitted on the surface, the area outside the blitting rectangle is ignored.
277
278<procedure>(sdl-set-clip-rect! sdl-surface sdl-rect)</procedure>
279Sets the clipping rectangle ({{sdl-rect}}) for the surface ({{sdl-surface}}). When something is blitted on the surface, the area outside the blitting rectangle is ignored. If the clipping rectangle is larger than surface, it is cropped to surface size. If area is NULL (TODO: how to pass null rect in Scheme?), the clipping rectangle is set to the surface size.
280
281<procedure>(sdl-set-color-key! sdl-surface flags key)</procedure>
282Sets the colour key for the given {{sdl-surface) and/or turns its RLE acceleration settings on or off. {{flags}} is an integer that can be {{SDL_SRCCOLORKEY}} (if set, {{key}} is the new colour key), {{SDL_RLEACCEL}} (if set, surface will be stored with RLE acceleration), or a sum of both. {{key}} is an integer value representing the colour that will be considered transparent when drawing (you can obtain this value via {{sdl-map-rgb}}).
283
284<procedure>(sdl-set-alpha! ...)</procedure>
285TODO
286
287<procedure>(sdl-display-format sdl-surface)</procedure>
288Creates a new surface with the same format as the display format and width and height same as {{sdl-surface}} and copies {{sdl-surface}}'s content into the new surface. If colour key or alpha value are needed, they should be set before calling this procedure. If alpha channel is needed, {{sdl-display-format-alpha}} should be used.
289
290<procedure>(sdl-display-format-alpha sdl-display-format-alpha)</procedure>
291Creates a new surface with the same format as the display format, with alpha channel, and with width and height same as {{sdl-surface}}, and then copies {{sdl-surface}}'s content into the new surface. If colour key or alpha value are needed, they should be set before calling this procedure. If colour key is set, it will be converted into alpha channel.
292
293<procedure>(sdl-convert-surface sdl-surface pixel-format flags)</procedure>
294Creates a new the surface with the pixel format given ({{pixel-format}}) and copies contents of {{sdl-surface}} into it. Flags are the same as for the sdl-create-rgb-surface procedure: {{SDL_SWSURFACE}}, {{SDL_HWSURFACE}} (surface resides in software or hardware memory respectively), {{SDL_SRCCOLORKEY}} (surface has colour key), {{SDL_SRCALPHA}} (surface has alpha-channel transparency); flags can be combined with {{+}}.
295
296<procedure>(sdl-init ...)</procedure>
297<procedure>(sdl-init-sub-system ...)</procedure>
298<procedure>(sdl-quit-sub-system ...)</procedure>
299<procedure>(sdl-quit ...)</procedure>
300<procedure>(sdl-was-init ...)</procedure>
301<procedure>(sdl-get-error ...)</procedure>
302<procedure>(sdl-clear-error! ...)</procedure>
303
304<procedure>(sdl-wm-set-caption title icon)</procedure>
305Sets the title and icon caption of the window to the strings passed as its arguments. (TODO: what exactly is icon caption???)
306
307<procedure>(sdl-wm-get-caption-title)</procedure>
308Evaluates to the string representing the current title caption of a window.
309
310<procedure>(sdl-wm-get-caption-icon)</procedure>
311Evaluates to the string representing the current icon caption of a window.
312
313<procedure>(sdl-wm-get-caption)</procedure>
314Returns two string values: the current title and icon caption of a window.
315
316<procedure>(sdl-wm-set-icon icon mask)</procedure>
317TODO
318
319<procedure>(sdl-wm-iconify-window ...)</procedure>
320<procedure>(sdl-wm-toggle-full-screen ...)</procedure>
321<procedure>(sdl-wm-grab-input ...)</procedure>
322<procedure>(sdl-get-ticks ...)</procedure>
323<procedure>(sdl-delay ...)</procedure>
324<procedure>(timer? ...)</procedure>
325This is a type predicate for timers.  Since there's no way ATM for you to get a reference to a timer, this will always return #f.
326
327<procedure>(get-time-of-day ...)</procedure>
328<procedure>(get-time-of-day ...)</procedure>
329<procedure>(sdl-add-relative-timer! time callback)</procedure>
330Register {{callback}} to be called {{time}} seconds in the future.  The callback will be called as a side effect of {{sdl-wait-event!*}}, so if you don't use {{sdl-wait-event!*}} or {{sdl-wait-event!}} (e.g. because you use {{sdl-poll-event!}} instead) your callbacks will never be invoked.
331
332This doesn't use the SDL timer functionality, so the C {{SDL_*Timer}} documentation doesn't apply.  In particular, you shouldn't worry about threading issues.
333
334<procedure>(sdl-pump-events ...)</procedure>
335<procedure>(sdl-poll-event! ...)</procedure>
336<procedure>(sdl-wait-event!* delay-function [sdl-event])</procedure>
337Wait for a new SDL Event.  {{delay-function}} is expected to take a single number and sleep that many milliseconds (call {{sdl-wait-event!}} instead if you're unsure what to use).  If {{sdl-event}} is provided, it will be populated with the event data.
338
339<procedure>(sdl-wait-event! [sdl-event])</procedure>
340Same as {{(sdl-wait-event!* sdl-delay [sdl-event])}}.
341
342<procedure>(sdl-push-event ...)</procedure>
343<procedure>(sdl-event-state! ...)</procedure>
344<procedure>(sdl-get-mouse-state ...)</procedure>
345<procedure>(sdl-warp-mouse ...)</procedure>
346<procedure>(sdl-enable-unicode ...)</procedure>
347<procedure>(sdl-get-video-surface ...)</procedure>
348<procedure>(sdl-video-driver-name ...)</procedure>
349<procedure>(sdl-set-video-mode ...)</procedure>
350<procedure>(sdl-video-mode-ok ...)</procedure>
351<procedure>(sdl-show-cursor ...)</procedure>
352
353<procedure>(sdl-map-rgb sdl-pixel-format r g b)</procedure>
354Returns a 32-bit integer representing the colour with the corresponding values of red ({{r}}), green ({{g}}) and blue ({{b}}) components according to the given {{sdl-pixel-format}}. Arguments {{r}}, {{g}} and {{b}} must be integers from 0 to 255 (#xFF). If the colour cannot be represented, the closest match is returned. If the surface supports transparency, fully opaque colour is returned.
355
356<procedure>(sdl-map-rgba sdl-pixel-format r g b a)</procedure>
357Returns a 32-bit integer representing the colour with the corresponding values of red ({{r}}), green ({{g}}), blue ({{b}}) and alpha ({{a}}) components according to the given {{sdl-pixel-format}}. Arguments {{r}}, {{g}}, {{b}} and {{a}} must be integers from 0 to 255 (#xFF). If the colour cannot be represented, the closest match is returned. If the surface doesn't support transparency, {{a}} is ignored (it's the same as #xFF).
358
359<procedure>(sdl-fill-rect ...)</procedure>
360<procedure>(sdl-flip ...)</procedure>
361<procedure>(sdl-free-surface ...)</procedure>
362<procedure>(sdl-blit-surface ...)</procedure>
363<procedure>(sdl-with-clip-rect ...)</procedure>
364<procedure>(make-sdl-joystick ...)</procedure>
365<procedure>(sdl-joystick-pointer ...)</procedure>
366<procedure>(sdl-joystick? ...)</procedure>
367<procedure>(sdl-joystick-event-state ...)</procedure>
368<procedure>(sdl-joystick-update ...)</procedure>
369<procedure>(sdl-num-joysticks ...)</procedure>
370<procedure>(sdl-joystick-name ...)</procedure>
371<procedure>(sdl-joystick-open ...)</procedure>
372<procedure>(sdl-joystick-opened ...)</procedure>
373<procedure>(sdl-joystick-index ...)</procedure>
374<procedure>(sdl-joystick-num-axes ...)</procedure>
375<procedure>(sdl-joystick-num-balls ...)</procedure>
376<procedure>(sdl-joystick-num-hats ...)</procedure>
377<procedure>(sdl-joystick-num-buttons ...)</procedure>
378<procedure>(sdl-joystick-update ...)</procedure>
379<procedure>(sdl-joystick-get-axis ...)</procedure>
380<procedure>(sdl-joystick-get-hat ...)</procedure>
381<procedure>(sdl-joystick-get-button ...)</procedure>
382<procedure>(sdl-joystick-close ...)</procedure>
383<procedure>(sdl-gl-swap-buffers ...)</procedure>
384<procedure>(sdl-gl-set-attribute ...)</procedure>
385<procedure>(sdl-gl-get-attribute ...)</procedure>
386<procedure>(heap? ...)</procedure>
387
388=== Links
389
390* SDL homepage: [[http://www.libsdl.org/]]
391* SDL documentation: [[http://www.libsdl.org/intro.en/toc.html]]
Note: See TracBrowser for help on using the repository browser.