Changeset 32849 in project


Ignore:
Timestamp:
11/02/15 02:05:35 (5 years ago)
Author:
John Croisant
Message:

More work on sdl2 docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/sdl2

    r32846 r32849  
    1212CHICKEN-idiomatic interface to SDL2. It takes care of the annoying
    1313low-level C stuff for you, so you can focus on making your game.
     14
     15If a feature you need is not yet available, please
     16[[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/CONTRIBUTING.md#filing-feature-requests|file a feature request]]
     17or contact a maintainer, so we can prioritize adding it.
    1418
    1519; Project / Source Code Repository : [[https://gitlab.com/chicken-sdl2/chicken-sdl2]]
     
    1822; License: [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/LICENSE-BSD.txt|BSD 2-Clause]]
    1923
     24
    2025== Help Wanted!
    2126
     
    2934If you wish to help in any way, please contact the project maintainer.
    3035
     36
    3137== Installation
     38
     39'''ATTENTION:''' The sdl2 egg has not been released yet. For now, you
     40must download it from its source code repository and follow the
     41instructions in the README.
    3242
    3343When installing the egg, you should set the SDL2_FLAGS environment
     
    4858installation of the egg, not during normal use.
    4959
     60
    5061== Demos and Examples
    5162
     
    6374contains complete example games and programs made with chicken-sdl2.
    6475
     76
    6577== Related Libraries
    6678
     
    7183of SDL. Its API is not compatible with sdl2.
    7284
     85
    7386== Version History
    7487
     
    7689
    7790
     91
    7892== Reference Documentation
    7993
     94=== Conventions
     95
     96* Procedure names are lower case and hyphenated.
     97
     98* Procedures that return #t or #f are suffixed with "?".
     99
     100* Procedures that cause a mutation or side effect are suffixed with "!".
     101
     102* Procedures that set the value of an attribute are named like
     103  {{TYPE-ATTR-set!}}, e.g. {{sdl-rect-x-set!}}.
     104** In most cases, it is also possible to use {{(set! ...)}} to set
     105   the value of attributes, e.g. {{(set! (sdl-rect-x my-rect) 42)}}.
     106
     107* Some procedures return multiple values, e.g. {{sdl-window-size}}
     108  returns two values, the width and height. You can use {{receive}},
     109  {{let-values}}, etc. to catch all the return values.
     110
     111* Procedures that allocate a new object often have two versions, one
     112  without an asterisk and one with an asterisk, e.g.
     113  {{sdl-make-surface}} and {{sdl-make-surface*}}.
     114** The version without an asterisk returns an object whose memory will
     115   be automatically freed when the object is garbage collected. It is
     116   recommended to use this version for safety, unless you have a good
     117   reason to do manual memory management.
     118** The version with an asterisk returns an object that must be
     119   manually freed when you are done with it, using e.g.
     120   {{sdl-free-surface!}}. This is slightly more efficient (especially
     121   if you are allocating hundreds or thousands of objects), but if you
     122   forget to free it, your program will leak memory.
     123
     124* Many procedures that return an enum symbol or a list of enum
     125  symbols, also have a "raw" version that returns an integer value,
     126  e.g. {{sdl-event-type}} and {{sdl-event-type-raw}}.
     127** Setters that accept an enum symbol will also accept the
     128   corresponding integer value. Setters that accept a list of enum
     129   symbols will also accept an integer representing bitwise-or'd
     130   integer flags or masks.
     131
     132
     133
     134=== Enums
     135
     136The sdl2 egg uses symbols instead of integer constants, for things
     137like event types, keyboard keys, and init flags. See the
     138[[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md|enum tables]]
     139for details.
     140
     141
     142
    80143=== Struct Record Types
    81144
    82145<procedure>(sdl-struct-null? record)</procedure>
    83146
    84 Returns #t if the given record instance, which can be an instance of
    85 any of the struct record types provided by this library, is wrapping a
    86 null pointer. Usually this indicates that the struct's memory has been
    87 manually freed. It is an error to get or set any field of a record
    88 that is wrapping a null pointer. So, you can use this procedure to
    89 test whether it is safe to use the object.
     147Returns #t if the given record instance is wrapping a null pointer.
     148{{record}} can be an instance of any of the struct record types
     149provided by this library. Usually this indicates that the underlying
     150struct has been manually freed (e.g. using {{sdl-free-surface!}}). It
     151is an error to get or set any field of a record that is wrapping a
     152null pointer. So, you can use this procedure to check whether it is
     153safe to use the record.
     154
    90155
    91156
     
    95160[[https://wiki.libsdl.org/SDL_AudioCVT|SDL_AudioCVT]] struct.
    96161
    97 <procedure>(sdl-audio-cvt? x) → boolean</procedure>
    98 
    99 Returns #t if x is a sdl-audio-cvt instance.
     162
     163<procedure>(sdl-audio-cvt? obj) → boolean</procedure>
     164
     165Returns #t if {{obj}} is a sdl-audio-cvt.
     166
    100167
    101168<procedure>(sdl-audio-cvt-needed audio-cvt) → fixnum</procedure>
     
    103170Get the value of the SDL_AudioCVT's "needed" field, as an integer.
    104171
     172
    105173<procedure>(sdl-audio-cvt-src-format audio-cvt) → symbol</procedure>
    106174
    107175Get the value of the SDL_AudioCVT's "src_format" field, as a symbol.
    108176
     177
    109178<procedure>(sdl-audio-cvt-src-format-raw audio-cvt) → fixnum</procedure>
    110179
    111180Get the value of the SDL_AudioCVT's "src_format" field, as an integer.
     181See also {{sdl-audio-cvt-src-format}}.
     182
    112183
    113184<procedure>(sdl-audio-cvt-dst-format audio-cvt) → symbol</procedure>
     
    115186Get the value of the SDL_AudioCVT's "dst_format" field, as a symbol.
    116187
     188
    117189<procedure>(sdl-audio-cvt-dst-format-raw audio-cvt) → fixnum</procedure>
    118190
    119191Get the value of the SDL_AudioCVT's "dst_format" field, as an integer.
     192See also {{sdl-audio-cvt-dst-format}}.
     193
    120194
    121195<procedure>(sdl-audio-cvt-rate-incr audio-cvt) → double</procedure>
     
    123197Get the value of the SDL_AudioCVT's "rate_incr" field, as a double
    124198precision floating point number.
     199
    125200
    126201<procedure>(sdl-audio-cvt-buf audio-cvt) → pointer</procedure>
     
    130205array.
    131206
     207
    132208<procedure>(sdl-audio-cvt-len audio-cvt) → fixnum</procedure>
    133209
     
    135211is the length of the array returned by sdl-audio-cvt-buf.
    136212
     213
    137214<procedure>(sdl-audio-cvt-len-cvt audio-cvt) → fixnum</procedure>
    138215
    139216Get the value of the SDL_AudioCVT's "len_cvt" field, as an integer.
    140217
     218
    141219<procedure>(sdl-audio-cvt-len-mult audio-cvt) → fixnum</procedure>
    142220
    143221Get the value of the SDL_AudioCVT's "len_mult" field, as an integer.
     222
    144223
    145224<procedure>(sdl-audio-cvt-len-ratio audio-cvt) → double</procedure>
     
    149228
    150229
     230
    151231==== sdl-audio-spec
    152232
     
    154234[[https://wiki.libsdl.org/SDL_AudioSpec|SDL_AudioSpec]] struct.
    155235
    156 <procedure>(sdl-audio-spec? x) → boolean</procedure>
    157 
    158 Returns #t if x is a sdl-audio-spec instance.
     236
     237<procedure>(sdl-audio-spec? obj) → boolean</procedure>
     238
     239Returns #t if {{obj}} is a sdl-audio-spec.
     240
    159241
    160242<procedure>(sdl-audio-spec-freq audio-spec) → fixnum</procedure>
     
    165247integer (int).
    166248
     249
    167250<procedure>(sdl-audio-spec-format audio-spec) → symbol</procedure>
    168251<setter>(set! (sdl-audio-spec-format audio-spec) format)</setter>
     
    172255symbol. When setting, either a symbol or an integer will be accepted.
    173256
     257
    174258<procedure>(sdl-audio-spec-format-raw audio-spec) → fixnum</procedure>
    175259<setter>(set! (sdl-audio-spec-format-raw audio-spec) val)</setter>
    176260
    177261Get or set the value of the SDL_AudioSpec's "format" field, as an
    178 integer.
     262integer. See also {{sdl-audio-spec-format}}.
     263
    179264
    180265<procedure>(sdl-audio-spec-channels audio-spec) → fixnum</procedure>
     
    185270integer (Uint8).
    186271
     272
    187273<procedure>(sdl-audio-spec-silence audio-spec) → fixnum</procedure>
    188274
    189275Returns the value of the SDL_AudioSpec's "silence" field, as an
    190276integer (Uint8).
     277
    191278
    192279<procedure>(sdl-audio-spec-samples audio-spec) → fixnum</procedure>
     
    197284integer (Uint16).
    198285
     286
    199287<procedure>(sdl-audio-spec-size audio-spec) → fixnum</procedure>
    200288
    201289Returns the value of the SDL_AudioSpec's "size" field, as an integer
    202290(Uint32).
     291
    203292
    204293<procedure>(sdl-audio-spec-userdata audio-spec) → pointer</procedure>
     
    210299
    211300
     301
    212302==== sdl-color
    213303
     
    219309from the name difference, the procedures behave exactly the same.
    220310
    221 <procedure>(sdl-color? x) → boolean</procedure>
    222 <procedure>(sdl-colour? x) → boolean</procedure>
    223 
    224 Returns #t if x is a sdl-color instance.
     311
     312<procedure>(sdl-color? obj) → boolean</procedure>
     313<procedure>(sdl-colour? obj) → boolean</procedure>
     314
     315Returns #t if {{obj}} is a sdl-color.
     316
    225317
    226318<procedure>(sdl-make-color #!optional r g b a) → sdl-color</procedure>
     
    238330255 (full opacity).
    239331
     332
    240333<procedure>(sdl-alloc-color) → sdl-color</procedure>
    241334<procedure>(sdl-alloc-colour) → sdl-color</procedure>
     
    247340memory will automatically be freed when the record instance is garbage
    248341collected. It is not necessary to call {{sdl-free-color!}}, although
    249 it is safe to do so.
     342it is safe (and sometimes useful) to do so.
     343
    250344
    251345<procedure>(sdl-alloc-color*) → sdl-color</procedure>
     
    257351automatically freed when the instance is garbage collected. You must
    258352manually call {{sdl-free-color!}} on the record instance when you are
    259 done with it; otherwise, your program will have a memory leak.
     353done with it; otherwise, your program will leak memory.
     354
    260355
    261356<procedure>(sdl-free-color! color)</procedure>
     
    267362freed. It is safe to free an instance that has a finalizer. It is safe
    268363to free an instance that has already been freed.
     364
    269365
    270366<procedure>(sdl-color-r color) → fixnum</procedure>
     
    278374range 0 to 255 (inclusive).
    279375
     376
    280377<procedure>(sdl-color-g color) → fixnum</procedure>
    281378<procedure>(sdl-colour-g color) → fixnum</procedure>
     
    288385the range 0 to 255 (inclusive).
    289386
     387
    290388<procedure>(sdl-color-b color) → fixnum</procedure>
    291389<procedure>(sdl-colour-b color) → fixnum</procedure>
     
    298396range 0 to 255 (inclusive).
    299397
     398
    300399<procedure>(sdl-color-a color) → fixnum</procedure>
    301400<procedure>(sdl-colour-a color) → fixnum</procedure>
     
    308407the range 0 to 255 (inclusive).
    309408
     409
    310410<setter>(sdl-color-set! color #!optional r g b a) → color</setter>
    311411<setter>(sdl-colour-set! color #!optional r g b a) → color</setter>
     
    316416{{color}} after it is modified.
    317417
     418
    318419<procedure>(sdl-color->list color) → list of fixnums</procedure>
    319420<procedure>(sdl-colour->list color) → list of fixnums</procedure>
     
    323424
    324425
     426
    325427==== sdl-cursor
    326428
     
    328430[[https://wiki.libsdl.org/SDL_CreateCursor|SDL_Cursor]] struct.
    329431
    330 <procedure>(sdl-cursor? x) → boolean</procedure>
    331 
    332 Returns #t if x is a sdl-cursor instance.
     432
     433<procedure>(sdl-cursor? obj) → boolean</procedure>
     434
     435Returns #t if {{obj}} is a sdl-cursor.
     436
    333437
    334438
     
    338442[[https://wiki.libsdl.org/SDL_DisplayMode|SDL_DisplayMode]] struct.
    339443
    340 <procedure>(sdl-display-mode? x) → boolean</procedure>
    341 
    342 Returns #t if x is a sdl-display-mode instance.
     444
     445<procedure>(sdl-display-mode? obj) → boolean</procedure>
     446
     447Returns #t if {{obj}} is a sdl-display-mode.
     448
    343449
    344450<procedure>(sdl-alloc-display-mode) → sdl-display-mode</procedure>
     
    349455memory will automatically be freed when the record instance is garbage
    350456collected. It is not necessary to call {{sdl-free-display-mode!}},
    351 although it is safe to do so.
     457although it is safe (and sometimes useful) to do so.
     458
    352459
    353460<procedure>(sdl-alloc-display-mode*) → sdl-display-mode</procedure>
     
    360467leak.
    361468
     469
    362470<procedure>(sdl-free-display-mode! display-mode)</procedure>
    363471
     
    368476to free an instance that has already been freed.
    369477
     478
    370479<procedure>(sdl-display-mode-format display-mode) → symbol</procedure>
    371480<setter>(set! (sdl-display-mode-format display-mode) val)</setter>
    372481<setter>(sdl-display-mode-format-set! display-mode)</setter>
    373482
     483TODO: Docs.
     484
     485
    374486<procedure>(sdl-display-mode-format-raw display-mode) → fixnum</procedure>
    375487<setter>(set! (sdl-display-mode-format-raw display-mode) val)</setter>
     488
     489TODO: Docs.
     490See also {{sdl-display-mode-format}}.
     491
    376492
    377493<procedure>(sdl-display-mode-w display-mode) → fixnum</procedure>
     
    379495<setter>(sdl-display-mode-w-set! display-mode)</setter>
    380496
     497TODO: Docs.
     498
     499
    381500<procedure>(sdl-display-mode-h display-mode) → fixnum</procedure>
    382501<setter>(set! (sdl-display-mode-h display-mode) val)</setter>
    383502<setter>(sdl-display-mode-h-set! display-mode)</setter>
    384503
     504TODO: Docs.
     505
     506
    385507<procedure>(sdl-display-mode-refresh-rate display-mode) → fixnum</procedure>
    386508<setter>(set! (sdl-display-mode-refresh-rate display-mode) val)</setter>
    387509<setter>(sdl-display-mode-refresh-rate-set! display-mode)</setter>
    388510
     511TODO: Docs.
     512
     513
    389514
    390515==== sdl-event
     
    392517sdl-event is a record type that wraps a pointer to a
    393518[[https://wiki.libsdl.org/SDL_Event|SDL_Event]]. There are many
    394 specific event structs, and the sdl-event record type wraps them all.
    395 However, there are variants depending on the
    396 [[https://wiki.libsdl.org/SDL_EventType|event type]]. Some event types
    397 use the same variant as other event types.
     519specific event structs in SDL, and the sdl-event record type wraps
     520them all. Each event struct has a corresponding variant of sdl-event,
     521described below. Each variant has one or more associated
     522[[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbols]].
     523
    398524
    399525<table>
    400526  <tr>
    401     <th>Variant</th>
    402     <th>Struct</th>
    403     <th>Corresponding event types (as symbols)</th>
     527    <th>Variant of sdl-event</th>
     528    <th>Underlying struct</th>
     529    <th>Event type symbol(s)</th>
    404530  </tr>
    405531  <tr>
    406532    <td>sdl-controller-axis-event</td>
    407533    <td>[[https://wiki.libsdl.org/SDL_ControllerAxisEvent|SDL_ControllerAxisEvent]]</td>
    408     <td>{{'controller-axis-motion}}</td>
     534    <td>controller-axis-motion</td>
    409535  </tr>
    410536  <tr>
    411537    <td>sdl-controller-button-event</td>
    412538    <td>[[https://wiki.libsdl.org/SDL_ControllerButtonEvent|SDL_ControllerButtonEvent]]</td>
    413     <td>{{'controller-button-down}} {{'controller-button-up}}</td>
     539    <td>controller-button-down<br>
     540        controller-button-up</td>
    414541  </tr>
    415542  <tr>
    416543    <td>sdl-controller-device-event</td>
    417544    <td>[[https://wiki.libsdl.org/SDL_ControllerDeviceEvent|SDL_ControllerDeviceEvent]]</td>
    418     <td>{{'controller-device-added}} {{'controller-device-removed}} {{'controller-device-remapped}}</td>
     545    <td>controller-device-added<br>
     546        controller-device-removed<br>
     547        controller-device-remapped</td>
    419548  </tr>
    420549  <tr>
    421550    <td>sdl-dollar-gesture-event</td>
    422551    <td>[[https://wiki.libsdl.org/SDL_DollarGestureEvent|SDL_DollarGestureEvent]]</td>
    423     <td>{{'dollar-gesture}} {{'dollar-record}}</td>
     552    <td>dollar-gesture<br>
     553        dollar-record</td>
    424554  </tr>
    425555  <tr>
    426556    <td>sdl-drop-event</td>
    427557    <td>[[https://wiki.libsdl.org/SDL_DropEvent|SDL_DropEvent]]</td>
    428     <td>{{'drop-file}}</td>
     558    <td>drop-file</td>
    429559  </tr>
    430560  <tr>
    431561    <td>sdl-joy-axis-event</td>
    432562    <td>[[https://wiki.libsdl.org/SDL_JoyAxisEvent|SDL_JoyAxisEvent]]</td>
    433     <td>{{'joy-axis-motion}}</td>
     563    <td>joy-axis-motion</td>
    434564  </tr>
    435565  <tr>
    436566    <td>sdl-joy-ball-event</td>
    437567    <td>[[https://wiki.libsdl.org/SDL_JoyBallEvent|SDL_JoyBallEvent]]</td>
    438     <td>{{'joy-ball-motion}}</td>
     568    <td>joy-ball-motion</td>
    439569  </tr>
    440570  <tr>
    441571    <td>sdl-joy-button-event</td>
    442572    <td>[[https://wiki.libsdl.org/SDL_JoyButtonEvent|SDL_JoyButtonEvent]]</td>
    443     <td>{{'joy-button-down}} {{'joy-button-up}}</td>
     573    <td>joy-button-down<br>
     574        joy-button-up</td>
    444575  </tr>
    445576  <tr>
    446577    <td>sdl-joy-device-event</td>
    447578    <td>[[https://wiki.libsdl.org/SDL_JoyDeviceEvent|SDL_JoyDeviceEvent]]</td>
    448     <td>{{'joy-device-added}} {{'joy-device-removed}}</td>
     579    <td>joy-device-added<br>
     580        joy-device-removed</td>
    449581  </tr>
    450582  <tr>
    451583    <td>sdl-joy-hat-event</td>
    452584    <td>[[https://wiki.libsdl.org/SDL_JoyHatEvent|SDL_JoyHatEvent]]</td>
    453     <td>{{'joy-hat-motion}}</td>
     585    <td>joy-hat-motion</td>
    454586  </tr>
    455587  <tr>
    456588    <td>sdl-keyboard-event</td>
    457589    <td>[[https://wiki.libsdl.org/SDL_KeyboardEvent|SDL_KeyboardEvent]]</td>
    458     <td>{{'key-down}} {{'key-up}}</td>
     590    <td>key-down<br>
     591        key-up</td>
    459592  </tr>
    460593  <tr>
    461594    <td>sdl-mouse-button-event</td>
    462595    <td>[[https://wiki.libsdl.org/SDL_MouseButtonEvent|SDL_MouseButtonEvent]]</td>
    463     <td>{{'mouse-button-down}} {{'mouse-button-up}}</td>
     596    <td>mouse-button-down<br>
     597        mouse-button-up</td>
    464598  </tr>
    465599  <tr>
    466600    <td>sdl-mouse-motion-event</td>
    467601    <td>[[https://wiki.libsdl.org/SDL_MouseMotionEvent|SDL_MouseMotionEvent]]</td>
    468     <td>{{'mouse-motion}}</td>
     602    <td>mouse-motion</td>
    469603  </tr>
    470604  <tr>
    471605    <td>sdl-mouse-wheel-event</td>
    472606    <td>[[https://wiki.libsdl.org/SDL_MouseWheelEvent|SDL_MouseWheelEvent]]</td>
    473     <td>{{'mouse-wheel}}</td>
     607    <td>mouse-wheel</td>
    474608  </tr>
    475609  <tr>
    476610    <td>sdl-multi-gesture-event</td>
    477611    <td>[[https://wiki.libsdl.org/SDL_MultiGestureEvent|SDL_MultiGestureEvent]]</td>
    478     <td>{{'multi-gesture}}</td>
     612    <td>multi-gesture</td>
    479613  </tr>
    480614  <tr>
    481615    <td>sdl-quit-event</td>
    482616    <td>[[https://wiki.libsdl.org/SDL_QuitEvent|SDL_QuitEvent]]</td>
    483     <td>{{'quit}}</td>
     617    <td>quit</td>
    484618  </tr>
    485619  <tr>
    486620    <td>sdl-sys-wm-event</td>
    487621    <td>[[https://wiki.libsdl.org/SDL_SysWMEvent|SDL_SysWMEvent]]</td>
    488     <td>{{'sys-wm}}</td>
     622    <td>sys-wm</td>
    489623  </tr>
    490624  <tr>
    491625    <td>sdl-text-editing-event</td>
    492626    <td>[[https://wiki.libsdl.org/SDL_TextEditingEvent|SDL_TextEditingEvent]]</td>
    493     <td>{{'text-editing}}</td>
     627    <td>text-editing</td>
    494628  </tr>
    495629  <tr>
    496630    <td>sdl-text-input-event</td>
    497631    <td>[[https://wiki.libsdl.org/SDL_TextInputEvent|SDL_TextInputEvent]]</td>
    498     <td>{{'text-input}}</td>
     632    <td>text-input</td>
    499633  </tr>
    500634  <tr>
    501635    <td>sdl-touch-finger-event</td>
    502636    <td>[[https://wiki.libsdl.org/SDL_TouchFingerEvent|SDL_TouchFingerEvent]]</td>
    503     <td>{{'finger-down}} {{'finger-up}} {{'finger-motion}}</td>
     637    <td>finger-down<br>
     638        finger-up<br>
     639        finger-motion</td>
    504640  </tr>
    505641  <tr>
    506642    <td>sdl-user-event</td>
    507643    <td>[[https://wiki.libsdl.org/SDL_UserEvent|SDL_UserEvent]]</td>
    508     <td>{{'user}}</td>
     644    <td>user</td>
    509645  </tr>
    510646  <tr>
    511647    <td>sdl-window-event</td>
    512648    <td>[[https://wiki.libsdl.org/SDL_WindowEvent|SDL_WindowEvent]]</td>
    513     <td>{{'window}}</td>
     649    <td>window</td>
    514650  </tr>
    515651</table>
    516652
    517653
    518 <procedure>(sdl-event? x) → boolean</procedure>
    519 
    520 Returns #t if x is a sdl-event instance (any type).
     654
     655<procedure>(sdl-event? obj) → boolean</procedure>
     656
     657Returns #t if {{obj}} is any variant of sdl-event.
     658
    521659
    522660<procedure>(sdl-alloc-event)</procedure>
    523661
    524 Allocate (but do not initialize) a new sdl-event instance.
     662Allocate (but do not initialize) a new sdl-event instance. You can set
     663the event's type with {{sdl-event-type-set!}} to choose what variant
     664of sdl-event it should be.
    525665
    526666The instance will have a finalizer, so that the underlying struct's
    527667memory will automatically be freed when the record instance is garbage
    528668collected. It is not necessary to call {{sdl-free-event!}}, although
    529 it is safe to do so.
     669it is safe (and sometimes useful) to do so.
     670
    530671
    531672<procedure>(sdl-alloc-event*)</procedure>
     
    535676automatically freed when the instance is garbage collected. You must
    536677manually call {{sdl-free-event!}} on the record instance when you are
    537 done with it; otherwise, your program will have a memory leak.
     678done with it; otherwise, your program will leak memory.
     679
    538680
    539681<procedure>(sdl-free-event! event)</procedure>
    540682
    541 Manually free the memory of the given sdl-event instance. The
    542 instance's pointer will be set to null (see {{sdl-struct-null?}}), so
    543 you cannot get or set any field of the instance after it has been
    544 freed. It is safe to free an instance that has a finalizer. It is safe
    545 to free an instance that has already been freed.
     683Manually free the memory of the given sdl-event. You can use this
     684procedure with any variant of sdl-event. The instance's pointer will
     685be set to null (see {{sdl-struct-null?}}), so you cannot get or set
     686any field of the instance after it has been freed. It is safe to free
     687an instance that has a finalizer. It is safe to free an instance that
     688has already been freed.
     689
    546690
    547691<procedure>(sdl-event-type event) → symbol</procedure>
     
    549693<setter>(sdl-event-type-set! event)</setter>
    550694
    551 Get or set the sdl-event's event type as a symbol (see the table
    552 above). You can use this procedure with any type of sdl-event.
     695Get or set the sdl-event's event type, as a
     696[[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]].
     697You can use this procedure with any variant of sdl-event. Setting this
     698will change what variant of sdl-event it is. E.g. if you set it to the
     699symbol {{'key-down}}, the event will become a sdl-keyboard-event.
     700
    553701
    554702<procedure>(sdl-event-type-raw event) → fixnum</procedure>
     
    556704<setter>(sdl-event-type-raw-set! event)</setter>
    557705
    558 Get or set the sdl-event's event type as a nonnegative integer. You
    559 can use this procedure with any type of sdl-event.
     706Get or set the sdl-event's event type, as a nonnegative integer. You
     707can use this procedure with any variant of sdl-event.
     708See also {{sdl-event-type}}.
     709
    560710
    561711<procedure>(sdl-event-timestamp event) → fixnum</procedure>
     
    565715Get or set the event timestamp, as a nonnegative integer representing
    566716the time that the event occurred, in milliseconds since the SDL timer
    567 system was initialized. You can use this procedure with any type of
     717system was initialized. You can use this procedure with any variant of
    568718sdl-event.
    569719
    570720
     721
    571722===== sdl-controller-axis-event
    572723
    573 sdl-controller-axis-event is a kind of sdl-event that wraps a pointer to a
     724sdl-controller-axis-event is a variant of sdl-event that wraps a pointer to a
    574725[[https://wiki.libsdl.org/SDL_ControllerAxisEvent|SDL_ControllerAxisEvent]].
    575726
    576 <procedure>(sdl-controller-axis-event? x) → boolean</procedure>
     727
     728<procedure>(sdl-controller-axis-event? obj) → boolean</procedure>
     729
     730Returns #t if {{obj}} is a sdl-controller-axis-event.
     731
    577732
    578733<procedure>(sdl-controller-axis-event-which event) → fixnum</procedure>
     
    580735<setter>(sdl-controller-axis-event-which-set! event)</setter>
    581736
     737TODO: Docs.
     738
     739
    582740<procedure>(sdl-controller-axis-event-axis event) → fixnum</procedure>
    583741<setter>(set! (sdl-controller-axis-event-axis event) val)</setter>
    584742<setter>(sdl-controller-axis-event-axis-set! event)</setter>
    585743
     744TODO: Docs.
     745
     746
    586747<procedure>(sdl-controller-axis-event-value event) → fixnum</procedure>
    587748<setter>(set! (sdl-controller-axis-event-value event) val)</setter>
    588749<setter>(sdl-controller-axis-event-value-set! event)</setter>
    589750
     751TODO: Docs.
     752
     753
    590754
    591755===== sdl-controller-button-event
    592756
    593 sdl-controller-button-event is a kind of sdl-event that wraps a pointer to a
     757sdl-controller-button-event is a variant of sdl-event that wraps a pointer to a
    594758[[https://wiki.libsdl.org/SDL_ControllerButtonEvent|SDL_ControllerButtonEvent]].
    595759
    596 <procedure>(sdl-controller-button-event? x) → boolean</procedure>
     760
     761<procedure>(sdl-controller-button-event? obj) → boolean</procedure>
     762
     763TODO: Docs.
     764
    597765
    598766<procedure>(sdl-controller-button-event-which event) → fixnum</procedure>
     
    600768<setter>(sdl-controller-button-event-which-set! event)</setter>
    601769
     770TODO: Docs.
     771
     772
    602773<procedure>(sdl-controller-button-event-button event) → fixnum</procedure>
    603774<setter>(set! (sdl-controller-button-event-button event) val)</setter>
    604775<setter>(sdl-controller-button-event-button-set! event)</setter>
    605776
     777TODO: Docs.
     778
     779
    606780<procedure>(sdl-controller-button-event-state event) → boolean</procedure>
    607781<setter>(set! (sdl-controller-button-event-state event) val)</setter>
    608782<setter>(sdl-controller-button-event-state-set! event)</setter>
    609783
     784TODO: Docs.
     785
     786
    610787
    611788===== sdl-controller-device-event
    612789
    613 sdl-controller-device-event is a kind of sdl-event that wraps a pointer to a
     790sdl-controller-device-event is a variant of sdl-event that wraps a pointer to a
    614791[[https://wiki.libsdl.org/SDL_ControllerDeviceEvent|SDL_ControllerDeviceEvent]].
    615792
    616 <procedure>(sdl-controller-device-event? x) → boolean</procedure>
     793
     794<procedure>(sdl-controller-device-event? obj) → boolean</procedure>
     795
     796Returns #t if {{obj}} is a sdl-controller-device-event.
     797
    617798
    618799<procedure>(sdl-controller-device-event-which event) → fixnum</procedure>
     
    620801<setter>(sdl-controller-device-event-which-set! event)</setter>
    621802
     803TODO: Docs.
     804
     805
    622806
    623807===== sdl-dollar-gesture-event
    624808
    625 sdl-dollar-gesture-event is a kind of sdl-event that wraps a pointer to a
     809sdl-dollar-gesture-event is a variant of sdl-event that wraps a pointer to a
    626810[[https://wiki.libsdl.org/SDL_DollarGestureEvent|SDL_DollarGestureEvent]].
    627811
    628 <procedure>(sdl-dollar-gesture-event? x) → boolean</procedure>
     812
     813<procedure>(sdl-dollar-gesture-event? obj) → boolean</procedure>
     814
     815Returns #t if {{obj}} is a sdl-dollar-gesture-event.
     816
    629817
    630818<procedure>(sdl-dollar-gesture-event-touch-id event) → fixnum</procedure>
     
    632820<setter>(sdl-dollar-gesture-event-touch-id-set! event)</setter>
    633821
     822TODO: Docs.
     823
     824
    634825<procedure>(sdl-dollar-gesture-event-gesture-id event) → fixnum</procedure>
    635826<setter>(set! (sdl-dollar-gesture-event-gesture-id event) val)</setter>
    636827<setter>(sdl-dollar-gesture-event-gesture-id-set! event)</setter>
    637828
     829TODO: Docs.
     830
     831
    638832<procedure>(sdl-dollar-gesture-event-num-fingers event) → fixnum</procedure>
    639833<setter>(set! (sdl-dollar-gesture-event-num-fingers event) val)</setter>
    640834<setter>(sdl-dollar-gesture-event-num-fingers-set! event)</setter>
    641835
     836TODO: Docs.
     837
     838
    642839<procedure>(sdl-dollar-gesture-event-error event) → float</procedure>
    643840<setter>(set! (sdl-dollar-gesture-event-error event) val)</setter>
    644841<setter>(sdl-dollar-gesture-event-error-set! event)</setter>
    645842
     843TODO: Docs.
     844
     845
    646846<procedure>(sdl-dollar-gesture-event-x event) → float</procedure>
    647847<setter>(set! (sdl-dollar-gesture-event-x event) val)</setter>
    648848<setter>(sdl-dollar-gesture-event-x-set! event)</setter>
    649849
     850TODO: Docs.
     851
     852
    650853<procedure>(sdl-dollar-gesture-event-y event) → float</procedure>
    651854<setter>(set! (sdl-dollar-gesture-event-y event) val)</setter>
    652855<setter>(sdl-dollar-gesture-event-y-set! event)</setter>
    653856
     857TODO: Docs.
     858
     859
    654860
    655861===== sdl-drop-event
    656862
    657 sdl-drop-event is a kind of sdl-event that wraps a pointer to a
     863sdl-drop-event is a variant of sdl-event that wraps a pointer to a
    658864[[https://wiki.libsdl.org/SDL_DropEvent|SDL_DropEvent]].
    659865
    660 <procedure>(sdl-drop-event? x) → boolean</procedure>
     866
     867<procedure>(sdl-drop-event? obj) → boolean</procedure>
     868
     869Returns #t if {{obj}} is a sdl-drop-event.
     870
    661871
    662872<procedure>(sdl-drop-event-file event) → string</procedure>
     
    664874<setter>(sdl-drop-event-file-set! event)</setter>
    665875
     876TODO: Docs.
     877
     878
    666879
    667880===== sdl-joy-axis-event
    668881
    669 sdl-joy-axis-event is a kind of sdl-event that wraps a pointer to a
     882sdl-joy-axis-event is a variant of sdl-event that wraps a pointer to a
    670883[[https://wiki.libsdl.org/SDL_JoyAxisEvent|SDL_JoyAxisEvent]].
    671884
    672 <procedure>(sdl-joy-axis-event? x) → boolean</procedure>
     885
     886<procedure>(sdl-joy-axis-event? obj) → boolean</procedure>
     887
     888Returns #t if {{obj}} is a sdl-joy-axis-event.
     889
    673890
    674891<procedure>(sdl-joy-axis-event-which event) → fixnum</procedure>
     
    676893<setter>(sdl-joy-axis-event-which-set! event)</setter>
    677894
     895Returns the joystick ID number of the joystick that caused the event.
     896
    678897
    679898<procedure>(sdl-joy-axis-event-axis event) → fixnum</procedure>
     
    681900<setter>(sdl-joy-axis-event-axis-set! event)</setter>
    682901
     902Returns the number of the axis that was moved.
     903
     904
    683905<procedure>(sdl-joy-axis-event-value event) → fixnum</procedure>
    684906<setter>(set! (sdl-joy-axis-event-value event) val)</setter>
    685907<setter>(sdl-joy-axis-event-value-set! event)</setter>
    686908
     909Returns the new value of the axis, as an integer in the range -32768
     910to 32767 (inclusive).
     911
     912
    687913
    688914===== sdl-joy-ball-event
    689915
    690 sdl-joy-ball-event is a kind of sdl-event that wraps a pointer to a
     916sdl-joy-ball-event is a variant of sdl-event that wraps a pointer to a
    691917[[https://wiki.libsdl.org/SDL_JoyBallEvent|SDL_JoyBallEvent]].
    692918
    693 <procedure>(sdl-joy-ball-event? x) → boolean</procedure>
     919
     920<procedure>(sdl-joy-ball-event? obj) → boolean</procedure>
     921
     922Returns #t if {{obj}} is a sdl-joy-ball-event.
     923
    694924
    695925<procedure>(sdl-joy-ball-event-which event) → fixnum</procedure>
     
    697927<setter>(sdl-joy-ball-event-which-set! event)</setter>
    698928
     929Returns the joystick ID number of the joystick that caused the event.
     930
     931
    699932<procedure>(sdl-joy-ball-event-ball event) → fixnum</procedure>
    700933<setter>(set! (sdl-joy-ball-event-ball event) val)</setter>
    701934<setter>(sdl-joy-ball-event-ball-set! event)</setter>
    702935
     936Returns the number of the trackball that was moved.
     937
     938
    703939<procedure>(sdl-joy-ball-event-xrel event) → fixnum</procedure>
    704940<setter>(set! (sdl-joy-ball-event-xrel event) val)</setter>
    705941<setter>(sdl-joy-ball-event-xrel-set! event)</setter>
    706942
     943Returns an integer (possibly negative) indicating how the trackball
     944position changed on the X axis, relative to its previous position.
     945
     946
    707947<procedure>(sdl-joy-ball-event-yrel event) → fixnum</procedure>
    708948<setter>(set! (sdl-joy-ball-event-yrel event) val)</setter>
    709949<setter>(sdl-joy-ball-event-yrel-set! event)</setter>
    710950
     951Returns an integer (possibly negative) indicating how the trackball
     952position changed on the Y axis, relative to its previous position.
     953
     954
    711955
    712956===== sdl-joy-button-event
    713957
    714 sdl-joy-button-event is a kind of sdl-event that wraps a pointer to a
     958sdl-joy-button-event is a variant of sdl-event that wraps a pointer to a
    715959[[https://wiki.libsdl.org/SDL_JoyButtonEvent|SDL_JoyButtonEvent]].
    716960
    717 <procedure>(sdl-joy-button-event? x) → boolean</procedure>
     961
     962<procedure>(sdl-joy-button-event? obj) → boolean</procedure>
     963
     964Returns #t if {{obj}} is a sdl-joy-button-event.
     965
    718966
    719967<procedure>(sdl-joy-button-event-which event) → fixnum</procedure>
     
    721969<setter>(sdl-joy-button-event-which-set! event)</setter>
    722970
     971Returns the joystick ID number of the joystick that caused the event.
     972
     973
    723974<procedure>(sdl-joy-button-event-button event) → fixnum</procedure>
    724975<setter>(set! (sdl-joy-button-event-button event) val)</setter>
    725976<setter>(sdl-joy-button-event-button-set! event)</setter>
    726977
     978Returns the number of the button that was pressed or released.
     979
     980
    727981<procedure>(sdl-joy-button-event-state event) → boolean</procedure>
    728982<setter>(set! (sdl-joy-button-event-state event) val)</setter>
    729983<setter>(sdl-joy-button-event-state-set! event)</setter>
    730984
     985Returns #t if the button was pressed, or #f if the button was released.
     986You can also find out by checking the event type: {{'joy-button-down}}
     987for pressed, or {{'joy-button-up}} for released.
     988
     989
    731990
    732991===== sdl-joy-device-event
    733992
    734 sdl-joy-device-event is a kind of sdl-event that wraps a pointer to a
     993sdl-joy-device-event is a variant of sdl-event that wraps a pointer to a
    735994[[https://wiki.libsdl.org/SDL_JoyDeviceEvent|SDL_JoyDeviceEvent]].
    736995
    737 <procedure>(sdl-joy-device-event? x) → boolean</procedure>
     996
     997<procedure>(sdl-joy-device-event? obj) → boolean</procedure>
     998
     999Returns #t if {{obj}} is a sdl-joy-device-event.
     1000
    7381001
    7391002<procedure>(sdl-joy-device-event-which event) → fixnum</procedure>
     
    7411004<setter>(sdl-joy-device-event-which-set! event)</setter>
    7421005
     1006Returns the joystick ID number of the joystick that caused the event.
     1007
     1008
    7431009
    7441010===== sdl-joy-hat-event
    7451011
    746 sdl-joy-hat-event is a kind of sdl-event that wraps a pointer to a
     1012sdl-joy-hat-event is a variant of sdl-event that wraps a pointer to a
    7471013[[https://wiki.libsdl.org/SDL_JoyHatEvent|SDL_JoyHatEvent]].
    7481014
    749 <procedure>(sdl-joy-hat-event? x) → boolean</procedure>
     1015
     1016<procedure>(sdl-joy-hat-event? obj) → boolean</procedure>
     1017
     1018Returns #t if {{obj}} is a sdl-joy-hat-event.
     1019
    7501020
    7511021<procedure>(sdl-joy-hat-event-which event) → fixnum</procedure>
     
    7531023<setter>(sdl-joy-hat-event-which-set! event)</setter>
    7541024
     1025Returns the joystick ID number of the joystick that caused the event.
     1026
     1027
    7551028<procedure>(sdl-joy-hat-event-hat event) → fixnum</procedure>
    7561029<setter>(set! (sdl-joy-hat-event-hat event) val)</setter>
    7571030<setter>(sdl-joy-hat-event-hat-set! event)</setter>
    7581031
     1032Returns the number of the hat that was moved.
     1033
     1034
    7591035<procedure>(sdl-joy-hat-event-value event) → symbol</procedure>
    7601036<setter>(set! (sdl-joy-hat-event-value event) val)</setter>
    7611037<setter>(sdl-joy-hat-event-value-set! event)</setter>
    7621038
     1039Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#joystick-hat-position|joystick hat position symbol]] indicating the new joystick hat position.
     1040
     1041
    7631042<procedure>(sdl-joy-hat-event-value-raw event) → fixnum</procedure>
    7641043<setter>(set! (sdl-joy-hat-event-value-raw event) val)</setter>
    7651044<setter>(sdl-joy-hat-event-value-raw-set! event)</setter>
    7661045
     1046Returns an integer indicating the new joystick hat position.
     1047See also {{sdl-joy-hat-event-value}}.
     1048
    7671049
    7681050===== sdl-keyboard-event
    7691051
    770 sdl-keyboard-event is a kind of sdl-event that wraps a pointer to a
     1052sdl-keyboard-event is a variant of sdl-event that wraps a pointer to a
    7711053[[https://wiki.libsdl.org/SDL_KeyboardEvent|SDL_KeyboardEvent]].
    7721054
    773 <procedure>(sdl-keyboard-event? x) → boolean</procedure>
     1055
     1056<procedure>(sdl-keyboard-event? obj) → boolean</procedure>
     1057
     1058Returns #t if {{obj}} is a sdl-keyboard-event.
     1059
    7741060
    7751061<procedure>(sdl-keyboard-event-window-id event) → fixnum</procedure>
     
    7771063<setter>(sdl-keyboard-event-window-id-set! event)</setter>
    7781064
     1065Returns the ID number of the sdl-window that had keyboard focus at the
     1066time this event occurred, or 0 if no sdl-window had keyboard focus.
     1067
     1068
    7791069<procedure>(sdl-keyboard-event-state event) → boolean</procedure>
    7801070<setter>(set! (sdl-keyboard-event-state event) val)</setter>
    7811071<setter>(sdl-keyboard-event-state-set! event)</setter>
    7821072
     1073Returns #t if the key was pressed, or #f if the key was released. You
     1074can also find out by checking the event type: {{'key-down}} for
     1075pressed, or {{'key-up}} for released.
     1076
     1077
    7831078<procedure>(sdl-keyboard-event-repeat event) → fixnum</procedure>
    7841079<setter>(set! (sdl-keyboard-event-repeat event) val)</setter>
    7851080<setter>(sdl-keyboard-event-repeat-set! event)</setter>
    7861081
     1082Returns non-zero if this is a "key repeat" event (caused by the user
     1083pressing and holding the key for some time), or zero if this is not a
     1084"key repeat" event.
     1085
     1086
    7871087<procedure>(sdl-keyboard-event-keysym event) → sdl-keysym</procedure>
    7881088<setter>(set! (sdl-keyboard-event-keysym event) val)</setter>
    7891089<setter>(sdl-keyboard-event-keysym-set! event)</setter>
    7901090
     1091Returns a copy of the sdl-keysym representing the key that was pressed
     1092or released. Modifying the returned sdl-keysym will ''not'' change the
     1093event, but setting this field to a new sdl-keysym ''will'' change the
     1094event.
     1095
     1096Instead of using this procedure, it is more efficient and convenient
     1097to directly access the fields of the event's keysym, using one of
     1098these procedures:
     1099
     1100* {{sdl-keyboard-event-sym}}
     1101* {{sdl-keyboard-event-scancode}}
     1102* {{sdl-keyboard-event-mod}}
     1103
     1104
    7911105<procedure>(sdl-keyboard-event-sym event) → symbol</procedure>
    7921106<setter>(set! (sdl-keyboard-event-sym event) val)</setter>
    7931107<setter>(sdl-keyboard-event-sym-set! event)</setter>
    7941108
     1109Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-keycodes|keyboard keycode symbol]]
     1110representing the key that was pressed or released. Setting this will
     1111change the event.
     1112
     1113
    7951114<procedure>(sdl-keyboard-event-sym-raw event) → fixnum</procedure>
    7961115<setter>(set! (sdl-keyboard-event-sym-raw event) val)</setter>
    7971116<setter>(sdl-keyboard-event-sym-raw-set! event)</setter>
    7981117
     1118Returns an integer representing a keyboard keycode of the key that was
     1119pressed or released. Setting this will change the event.
     1120See also {{sdl-keyboard-event-sym}}.
     1121
     1122
    7991123<procedure>(sdl-keyboard-event-scancode event) → symbol</procedure>
    8001124<setter>(set! (sdl-keyboard-event-scancode event) val)</setter>
    8011125<setter>(sdl-keyboard-event-scancode-set! event)</setter>
    8021126
     1127Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]]
     1128representing the key that was pressed or released. Setting this will
     1129change the event.
     1130
     1131
    8031132<procedure>(sdl-keyboard-event-scancode-raw event) → fixnum</procedure>
    8041133<setter>(set! (sdl-keyboard-event-scancode-raw event) val)</setter>
    8051134<setter>(sdl-keyboard-event-scancode-raw-set! event)</setter>
    8061135
     1136Returns an integer representing a keyboard scancode of the key that
     1137was pressed or released. Setting this will change the event.
     1138See also {{sdl-keyboard-event-scancode}}.
     1139
     1140
    8071141<procedure>(sdl-keyboard-event-mod event) → list of symbols</procedure>
    8081142<setter>(set! (sdl-keyboard-event-mod event) val)</setter>
    8091143<setter>(sdl-keyboard-event-mod-set! event)</setter>
    8101144
     1145Returns a list of zero or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-modifiers|keyboard modifier symbols]],
     1146representing the modifier keys that were being pressed at the time the
     1147event occurred. Setting this will change the event.
     1148
     1149
    8111150<procedure>(sdl-keyboard-event-mod-raw event) → fixnum</procedure>
    8121151<setter>(set! (sdl-keyboard-event-mod-raw event) val)</setter>
    8131152<setter>(sdl-keyboard-event-mod-raw-set! event)</setter>
    8141153
     1154Returns an integer representing a bitfield of keyboard modifiers,
     1155representing the modifier keys that were being pressed at the time the
     1156event occurred. Setting this will change the event.
     1157See also {{sdl-keyboard-event-mod}}.
     1158
    8151159
    8161160===== sdl-mouse-button-event
    8171161
    818 sdl-mouse-button-event is a kind of sdl-event that wraps a pointer to a
     1162sdl-mouse-button-event is a variant of sdl-event that wraps a pointer to a
    8191163[[https://wiki.libsdl.org/SDL_MouseButtonEvent|SDL_MouseButtonEvent]].
    8201164
    821 <procedure>(sdl-mouse-button-event? x) → boolean</procedure>
     1165
     1166<procedure>(sdl-mouse-button-event? obj) → boolean</procedure>
     1167
     1168Returns #t if {{obj}} is a sdl-mouse-button-event.
     1169
    8221170
    8231171<procedure>(sdl-mouse-button-event-window-id event) → fixnum</procedure>
     
    8251173<setter>(sdl-mouse-button-event-window-id-set! event)</setter>
    8261174
     1175Returns the ID number of the sdl-window that had mouse focus at the
     1176time this event occurred, or 0 if no sdl-window had mouse focus.
     1177
     1178
    8271179<procedure>(sdl-mouse-button-event-which event) → fixnum</procedure>
    8281180<setter>(set! (sdl-mouse-button-event-which event) val)</setter>
    8291181<setter>(sdl-mouse-button-event-which-set! event)</setter>
    8301182
     1183TODO: Docs.
     1184
     1185
     1186<procedure>(sdl-mouse-button-event-button event) → symbol</procedure>
     1187<setter>(set! (sdl-mouse-button-event-button event) val)</setter>
     1188<setter>(sdl-mouse-button-event-button-set! event)</setter>
     1189
     1190Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#mouse-buttons|mouse button symbol]] indicating which button was pressed or released.
     1191
     1192
    8311193<procedure>(sdl-mouse-button-event-button-raw event) → fixnum</procedure>
    8321194<setter>(set! (sdl-mouse-button-event-button-raw event) val)</setter>
    8331195<setter>(sdl-mouse-button-event-button-raw-set! event)</setter>
    8341196
    835 <procedure>(sdl-mouse-button-event-button event) → symbol</procedure>
    836 <setter>(set! (sdl-mouse-button-event-button event) val)</setter>
    837 <setter>(sdl-mouse-button-event-button-set! event)</setter>
     1197Returns an integer indicating which button was pressed or released.
     1198See also {{sdl-mouse-button-event-button}}.
     1199
    8381200
    8391201<procedure>(sdl-mouse-button-event-state event) → boolean</procedure>
     
    8411203<setter>(sdl-mouse-button-event-state-set! event)</setter>
    8421204
     1205Returns #t if the button was pressed, or #f if the button was
     1206released. You can also find out by checking the event type:
     1207{{'mouse-button-down}} for pressed, or {{'mouse-button-up}} for
     1208released.
     1209
     1210
    8431211<procedure>(sdl-mouse-button-event-x event) → fixnum</procedure>
    8441212<setter>(set! (sdl-mouse-button-event-x event) val)</setter>
    8451213<setter>(sdl-mouse-button-event-x-set! event)</setter>
    8461214
     1215Returns the X position (in pixels) of the mouse cursor at the time the
     1216button was pressed or released.
     1217
     1218
    8471219<procedure>(sdl-mouse-button-event-y event) → fixnum</procedure>
    8481220<setter>(set! (sdl-mouse-button-event-y event) val)</setter>
    8491221<setter>(sdl-mouse-button-event-y-set! event)</setter>
    8501222
     1223Returns the Y position (in pixels) of the mouse cursor at the time the
     1224button was pressed or released.
     1225
     1226
    8511227
    8521228===== sdl-mouse-motion-event
    8531229
    854 sdl-mouse-motion-event is a kind of sdl-event that wraps a pointer to a
     1230sdl-mouse-motion-event is a variant of sdl-event that wraps a pointer to a
    8551231[[https://wiki.libsdl.org/SDL_MouseMotionEvent|SDL_MouseMotionEvent]].
    8561232
    857 <procedure>(sdl-mouse-motion-event? x) → boolean</procedure>
     1233
     1234<procedure>(sdl-mouse-motion-event? obj) → boolean</procedure>
     1235
     1236Returns #t if {{obj}} is a sdl-mouse-motion-event.
     1237
    8581238
    8591239<procedure>(sdl-mouse-motion-event-window-id event) → fixnum</procedure>
     
    8611241<setter>(sdl-mouse-motion-event-window-id-set! event)</setter>
    8621242
     1243Returns the ID number of the sdl-window that had mouse focus at the
     1244time this event occurred, or 0 if no sdl-window had mouse focus.
     1245
     1246
    8631247<procedure>(sdl-mouse-motion-event-which event) → fixnum</procedure>
    8641248<setter>(set! (sdl-mouse-motion-event-which event) val)</setter>
    8651249<setter>(sdl-mouse-motion-event-which-set! event)</setter>
    8661250
     1251TODO: Docs.
     1252
     1253
     1254<procedure>(sdl-mouse-motion-event-state event) → list of symbols</procedure>
     1255<setter>(set! (sdl-mouse-motion-event-state event) val)</setter>
     1256<setter>(sdl-mouse-motion-event-state-set! event)</setter>
     1257
     1258Returns a list of zero or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#mouse-button-masks|mouse button mask symbols]],
     1259representing the mouse buttons that were being pressed at the time
     1260this event occurred.
     1261
     1262
    8671263<procedure>(sdl-mouse-motion-event-state-raw event) → fixnum</procedure>
    8681264<setter>(set! (sdl-mouse-motion-event-state-raw event) val)</setter>
    8691265<setter>(sdl-mouse-motion-event-state-raw-set! event)</setter>
    8701266
    871 <procedure>(sdl-mouse-motion-event-state event) → list of symbols</procedure>
    872 <setter>(set! (sdl-mouse-motion-event-state event) val)</setter>
    873 <setter>(sdl-mouse-motion-event-state-set! event)</setter>
     1267Returns an integer representing the mouse buttons that were being
     1268pressed at the time this event occurred.
     1269See also {{sdl-mouse-motion-event-state}}
     1270
    8741271
    8751272<procedure>(sdl-mouse-motion-event-x event) → fixnum</procedure>
     
    8771274<setter>(sdl-mouse-motion-event-x-set! event)</setter>
    8781275
     1276Returns the X coordinate (in pixels) of the mouse cursor at the time
     1277the event occurred.
     1278
     1279
    8791280<procedure>(sdl-mouse-motion-event-y event) → fixnum</procedure>
    8801281<setter>(set! (sdl-mouse-motion-event-y event) val)</setter>
    8811282<setter>(sdl-mouse-motion-event-y-set! event)</setter>
    8821283
     1284Returns the Y coordinate (in pixels) of the mouse cursor at the time
     1285the event occurred.
     1286
     1287
    8831288<procedure>(sdl-mouse-motion-event-xrel event) → fixnum</procedure>
    8841289<setter>(set! (sdl-mouse-motion-event-xrel event) val)</setter>
    8851290<setter>(sdl-mouse-motion-event-xrel-set! event)</setter>
    8861291
     1292Returns how much the mouse cursor moved on the X axis (in pixels)
     1293since its previous position.
     1294
     1295
    8871296<procedure>(sdl-mouse-motion-event-yrel event) → fixnum</procedure>
    8881297<setter>(set! (sdl-mouse-motion-event-yrel event) val)</setter>
    8891298<setter>(sdl-mouse-motion-event-yrel-set! event)</setter>
    8901299
     1300Returns how much the mouse cursor moved on the Y axis (in pixels)
     1301since its previous position.
     1302
     1303
    8911304
    8921305===== sdl-mouse-wheel-event
    8931306
    894 sdl-mouse-wheel-event is a kind of sdl-event that wraps a pointer to a
     1307sdl-mouse-wheel-event is a variant of sdl-event that wraps a pointer to a
    8951308[[https://wiki.libsdl.org/SDL_MouseWheelEvent|SDL_MouseWheelEvent]].
    8961309
    897 <procedure>(sdl-mouse-wheel-event? x) → boolean</procedure>
     1310
     1311<procedure>(sdl-mouse-wheel-event? obj) → boolean</procedure>
     1312
     1313Returns #t if {{obj}} is a sdl-mouse-wheel-event.
     1314
    8981315
    8991316<procedure>(sdl-mouse-wheel-event-window-id event) → fixnum</procedure>
     
    9011318<setter>(sdl-mouse-wheel-event-window-id-set! event)</setter>
    9021319
     1320Returns the ID number of the sdl-window that had mouse focus at the
     1321time this event occurred, or 0 if no sdl-window had mouse focus.
     1322
     1323
    9031324<procedure>(sdl-mouse-wheel-event-which event) → fixnum</procedure>
    9041325<setter>(set! (sdl-mouse-wheel-event-which event) val)</setter>
    9051326<setter>(sdl-mouse-wheel-event-which-set! event)</setter>
    9061327
     1328TODO: Docs.
     1329
     1330
    9071331<procedure>(sdl-mouse-wheel-event-x event) → fixnum</procedure>
    9081332<setter>(set! (sdl-mouse-wheel-event-x event) val)</setter>
    9091333<setter>(sdl-mouse-wheel-event-x-set! event)</setter>
    9101334
     1335TODO: Docs.
     1336
     1337
    9111338<procedure>(sdl-mouse-wheel-event-y event) → fixnum</procedure>
    9121339<setter>(set! (sdl-mouse-wheel-event-y event) val)</setter>
    9131340<setter>(sdl-mouse-wheel-event-y-set! event)</setter>
    9141341
     1342TODO: Docs.
     1343
     1344
    9151345
    9161346===== sdl-multi-gesture-event
    9171347
    918 sdl-multi-gesture-event is a kind of sdl-event that wraps a pointer to a
     1348sdl-multi-gesture-event is a variant of sdl-event that wraps a pointer to a
    9191349[[https://wiki.libsdl.org/SDL_MultiGestureEvent|SDL_MultiGestureEvent]].
    9201350
    921 <procedure>(sdl-multi-gesture-event? x) → boolean</procedure>
     1351
     1352<procedure>(sdl-multi-gesture-event? obj) → boolean</procedure>
     1353
     1354Returns #t if {{obj}} is a sdl-multi-gesture-event.
     1355
    9221356
    9231357<procedure>(sdl-multi-gesture-event-touch-id event) → fixnum</procedure>
     
    9251359<setter>(sdl-multi-gesture-event-touch-id-set! event)</setter>
    9261360
     1361TODO: Docs.
     1362
     1363
    9271364<procedure>(sdl-multi-gesture-event-dtheta event) → float</procedure>
    9281365<setter>(set! (sdl-multi-gesture-event-dtheta event) val)</setter>
    9291366<setter>(sdl-multi-gesture-event-dtheta-set! event)</setter>
    9301367
     1368TODO: Docs.
     1369
     1370
    9311371<procedure>(sdl-multi-gesture-event-ddist event) → float</procedure>
    9321372<setter>(set! (sdl-multi-gesture-event-ddist event) val)</setter>
    9331373<setter>(sdl-multi-gesture-event-ddist-set! event)</setter>
    9341374
     1375TODO: Docs.
     1376
     1377
    9351378<procedure>(sdl-multi-gesture-event-x event) → float</procedure>
    9361379<setter>(set! (sdl-multi-gesture-event-x event) val)</setter>
    9371380<setter>(sdl-multi-gesture-event-x-set! event)</setter>
    9381381
     1382TODO: Docs.
     1383
     1384
    9391385<procedure>(sdl-multi-gesture-event-y event) → float</procedure>
    9401386<setter>(set! (sdl-multi-gesture-event-y event) val)</setter>
    9411387<setter>(sdl-multi-gesture-event-y-set! event)</setter>
    9421388
     1389TODO: Docs.
     1390
     1391
    9431392<procedure>(sdl-multi-gesture-event-num-fingers event) → fixnum</procedure>
    9441393<setter>(set! (sdl-multi-gesture-event-num-fingers event) val)</setter>
    9451394<setter>(sdl-multi-gesture-event-num-fingers-set! event)</setter>
    9461395
     1396TODO: Docs.
     1397
     1398
    9471399
    9481400===== sdl-quit-event
    9491401
    950 sdl-quit-event is a kind of sdl-event that wraps a pointer to a
     1402sdl-quit-event is a variant of sdl-event that wraps a pointer to a
    9511403[[https://wiki.libsdl.org/SDL_QuitEvent|SDL_QuitEvent]].
    9521404
    953 <procedure>(sdl-quit-event? x) → boolean</procedure>
     1405
     1406<procedure>(sdl-quit-event? obj) → boolean</procedure>
     1407
     1408Returns #t if {{obj}} is a sdl-quit-event.
     1409
    9541410
    9551411
    9561412===== sdl-sys-wm-event
    9571413
    958 sdl-sys-wm-event is a kind of sdl-event that wraps a pointer to a
     1414sdl-sys-wm-event is a variant of sdl-event that wraps a pointer to a
    9591415[[https://wiki.libsdl.org/SDL_SysWMEvent|SDL_SysWMEvent]].
    9601416
    961 <procedure>(sdl-sys-wm-event? x) → boolean</procedure>
     1417
     1418<procedure>(sdl-sys-wm-event? obj) → boolean</procedure>
     1419
     1420Returns #t if {{obj}} is a sdl-sys-wm-event.
     1421
    9621422
    9631423<procedure>(sdl-sys-wm-event-msg event) → sdl-sys-wm-msg</procedure>
     
    9651425<setter>(sdl-sys-wm-event-msg-set! event)</setter>
    9661426
     1427TODO: Docs.
     1428
     1429
    9671430
    9681431===== sdl-text-editing-event
    9691432
    970 sdl-text-editing-event is a kind of sdl-event that wraps a pointer to a
     1433sdl-text-editing-event is a variant of sdl-event that wraps a pointer to a
    9711434[[https://wiki.libsdl.org/SDL_TextEditingEvent|SDL_TextEditingEvent]].
    9721435
    973 <procedure>(sdl-text-editing-event? x) → boolean</procedure>
     1436
     1437<procedure>(sdl-text-editing-event? obj) → boolean</procedure>
     1438
     1439Returns #t if {{obj}} is a sdl-text-editing-event.
     1440
    9741441
    9751442<procedure>(sdl-text-editing-event-window-id event) → fixnum</procedure>
     
    9771444<setter>(sdl-text-editing-event-window-id-set! event)</setter>
    9781445
     1446TODO: Docs.
     1447
     1448
    9791449<procedure>(sdl-text-editing-event-text event) → string</procedure>
    9801450<setter>(set! (sdl-text-editing-event-text event) val)</setter>
    9811451<setter>(sdl-text-editing-event-text-set! event)</setter>
    9821452
     1453TODO: Docs.
     1454
     1455
    9831456<procedure>(sdl-text-editing-event-start event) → fixnum</procedure>
    9841457<setter>(set! (sdl-text-editing-event-start event) val)</setter>
    9851458<setter>(sdl-text-editing-event-start-set! event)</setter>
    9861459
     1460TODO: Docs.
     1461
     1462
    9871463<procedure>(sdl-text-editing-event-length event) → fixnum</procedure>
    9881464<setter>(set! (sdl-text-editing-event-length event) val)</setter>
    9891465<setter>(sdl-text-editing-event-length-set! event)</setter>
    9901466
     1467TODO: Docs.
     1468
     1469
    9911470
    9921471===== sdl-text-input-event
    9931472
    994 sdl-text-input-event is a kind of sdl-event that wraps a pointer to a
     1473sdl-text-input-event is a variant of sdl-event that wraps a pointer to a
    9951474[[https://wiki.libsdl.org/SDL_TextInputEvent|SDL_TextInputEvent]].
    9961475
    997 <procedure>(sdl-text-input-event? x) → boolean</procedure>
     1476
     1477<procedure>(sdl-text-input-event? obj) → boolean</procedure>
     1478
     1479Returns #t if {{obj}} is a sdl-text-input-event.
     1480
    9981481
    9991482<procedure>(sdl-text-input-event-window-id event) → fixnum</procedure>
     
    10011484<setter>(sdl-text-input-event-window-id-set! event)</setter>
    10021485
     1486TODO: Docs.
     1487
     1488
    10031489<procedure>(sdl-text-input-event-text event) → string</procedure>
    10041490<setter>(set! (sdl-text-input-event-text event) val)</setter>
    10051491<setter>(sdl-text-input-event-text-set! event)</setter>
    10061492
     1493TODO: Docs.
     1494
     1495
    10071496
    10081497===== sdl-touch-finger-event
    10091498
    1010 sdl-touch-finger-event is a kind of sdl-event that wraps a pointer to a
     1499sdl-touch-finger-event is a variant of sdl-event that wraps a pointer to a
    10111500[[https://wiki.libsdl.org/SDL_TouchFingerEvent|SDL_TouchFingerEvent]].
    10121501
    1013 <procedure>(sdl-touch-finger-event? x) → boolean</procedure>
     1502
     1503<procedure>(sdl-touch-finger-event? obj) → boolean</procedure>
     1504
     1505Returns #t if {{obj}} is a sdl-touch-finger-event.
     1506
    10141507
    10151508<procedure>(sdl-touch-finger-event-touch-id event) → fixnum</procedure>
     
    10171510<setter>(sdl-touch-finger-event-touch-id-set! event)</setter>
    10181511
     1512TODO: Docs.
     1513
     1514
    10191515<procedure>(sdl-touch-finger-event-finger-id event) → fixnum</procedure>
    10201516<setter>(set! (sdl-touch-finger-event-finger-id event) val)</setter>
    10211517<setter>(sdl-touch-finger-event-finger-id-set! event)</setter>
    10221518
     1519TODO: Docs.
     1520
     1521
    10231522<procedure>(sdl-touch-finger-event-x event) → float</procedure>
    10241523<setter>(set! (sdl-touch-finger-event-x event) val)</setter>
    10251524<setter>(sdl-touch-finger-event-x-set! event)</setter>
    10261525
     1526TODO: Docs.
     1527
     1528
    10271529<procedure>(sdl-touch-finger-event-y event) → float</procedure>
    10281530<setter>(set! (sdl-touch-finger-event-y event) val)</setter>
    10291531<setter>(sdl-touch-finger-event-y-set! event)</setter>
    10301532
     1533TODO: Docs.
     1534
     1535
    10311536<procedure>(sdl-touch-finger-event-dx event) → float</procedure>
    10321537<setter>(set! (sdl-touch-finger-event-dx event) val)</setter>
    10331538<setter>(sdl-touch-finger-event-dx-set! event)</setter>
    10341539
     1540TODO: Docs.
     1541
     1542
    10351543<procedure>(sdl-touch-finger-event-dy event) → float</procedure>
    10361544<setter>(set! (sdl-touch-finger-event-dy event) val)</setter>
    10371545<setter>(sdl-touch-finger-event-dy-set! event)</setter>
    10381546
     1547TODO: Docs.
     1548
     1549
    10391550<procedure>(sdl-touch-finger-event-pressure event) → float</procedure>
    10401551<setter>(set! (sdl-touch-finger-event-pressure event) val)</setter>
    10411552<setter>(sdl-touch-finger-event-pressure-set! event)</setter>
    10421553
     1554TODO: Docs.
     1555
     1556
    10431557
    10441558===== sdl-user-event
    10451559
    1046 sdl-user-event is a kind of sdl-event that wraps a pointer to a
     1560sdl-user-event is a variant of sdl-event that wraps a pointer to a
    10471561[[https://wiki.libsdl.org/SDL_UserEvent|SDL_UserEvent]].
    10481562
    1049 <procedure>(sdl-user-event? x) → boolean</procedure>
     1563
     1564<procedure>(sdl-user-event? obj) → boolean</procedure>
     1565
     1566Returns #t if {{obj}} is a sdl-user-event.
     1567
    10501568
    10511569<procedure>(sdl-user-event-window-id event) → fixnum</procedure>
     
    10531571<setter>(sdl-user-event-window-id-set! event)</setter>
    10541572
     1573TODO: Docs.
     1574
     1575
    10551576<procedure>(sdl-user-event-code event) → fixnum</procedure>
    10561577<setter>(set! (sdl-user-event-code event) val)</setter>
    10571578<setter>(sdl-user-event-code-set! event)</setter>
    10581579
     1580TODO: Docs.
     1581
     1582
    10591583<procedure>(sdl-user-event-data1 event) → pointer</procedure>
    10601584<setter>(set! (sdl-user-event-data1 event) val)</setter>
    10611585<setter>(sdl-user-event-data1-set! event)</setter>
    10621586
     1587TODO: Docs.
     1588
     1589
    10631590<procedure>(sdl-user-event-data2 event) → pointer</procedure>
    10641591<setter>(set! (sdl-user-event-data2 event) val)</setter>
    10651592<setter>(sdl-user-event-data2-set! event)</setter>
    10661593
     1594TODO: Docs.
     1595
     1596
    10671597
    10681598===== sdl-window-event
    10691599
    1070 sdl-window-event is a kind of sdl-event that wraps a pointer to a
     1600sdl-window-event is a variant of sdl-event that wraps a pointer to a
    10711601[[https://wiki.libsdl.org/SDL_WindowEvent|SDL_WindowEvent]].
    10721602
    1073 <procedure>(sdl-window-event? x) → boolean</procedure>
     1603
     1604<procedure>(sdl-window-event? obj) → boolean</procedure>
     1605
     1606Returns #t if {{obj}} is a sdl-window-event.
     1607
    10741608
    10751609<procedure>(sdl-window-event-window-id event) → fixnum</procedure>
     
    10771611<setter>(sdl-window-event-window-id-set! event)</setter>
    10781612
     1613TODO: Docs.
     1614
     1615
     1616<procedure>(sdl-window-event-event event) → symbol</procedure>
     1617<setter>(set! (sdl-window-event-event event) val)</setter>
     1618<setter>(sdl-window-event-event-set! event)</setter>
     1619
     1620Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#window-event-types|window event type]] indicating what happened to the window.
     1621
     1622
    10791623<procedure>(sdl-window-event-event-raw event) → fixnum</procedure>
    10801624<setter>(set! (sdl-window-event-event-raw event) val)</setter>
    10811625<setter>(sdl-window-event-event-raw-set! event)</setter>
    10821626
    1083 <procedure>(sdl-window-event-event event) → symbol</procedure>
    1084 <setter>(set! (sdl-window-event-event event) val)</setter>
    1085 <setter>(sdl-window-event-event-set! event)</setter>
     1627Returns an integer indicating what happened to the window.
     1628See also {{sdl-window-event-event}}.
     1629
    10861630
    10871631<procedure>(sdl-window-event-data1 event) → fixnum</procedure>
     
    10891633<setter>(sdl-window-event-data1-set! event)</setter>
    10901634
     1635TODO: Docs.
     1636
     1637
    10911638<procedure>(sdl-window-event-data2 event) → fixnum</procedure>
    10921639<setter>(set! (sdl-window-event-data2 event) val)</setter>
    10931640<setter>(sdl-window-event-data2-set! event)</setter>
    10941641
     1642TODO: Docs.
     1643
     1644
    10951645
    10961646==== sdl-finger
     
    10991649[[https://wiki.libsdl.org/SDL_Finger|SDL_Finger]] struct.
    11001650
    1101 <procedure>(sdl-finger? x) → boolean</procedure>
    1102 
    1103 Returns #t if x is a sdl-finger instance.
     1651
     1652<procedure>(sdl-finger? obj) → boolean</procedure>
     1653
     1654Returns #t if {{obj}} is a sdl-finger.
     1655
    11041656
    11051657<procedure>(sdl-finger-id finger) → fixnum</procedure>
     1658
     1659TODO: Docs.
     1660
     1661
    11061662<procedure>(sdl-finger-x finger) → float</procedure>
     1663
     1664TODO: Docs.
     1665
     1666
    11071667<procedure>(sdl-finger-y finger) → float</procedure>
     1668
     1669TODO: Docs.
     1670
     1671
    11081672<procedure>(sdl-finger-pressure finger) → float</procedure>
     1673
     1674TODO: Docs.
     1675
    11091676
    11101677
     
    11141681[[https://wiki.libsdl.org/SDL_Joystick|SDL_Joystick]] struct.
    11151682
    1116 <procedure>(sdl-joystick? x) → boolean</procedure>
    1117 
    1118 Returns #t if x is a sdl-joystick instance.
     1683
     1684<procedure>(sdl-joystick? obj) → boolean</procedure>
     1685
     1686Returns #t if {{obj}} is a sdl-joystick.
     1687
    11191688
    11201689
     
    11251694struct.
    11261695
    1127 <procedure>(sdl-joystick-guid? x) → boolean</procedure>
    1128 
    1129 Returns #t if x is a sdl-joystick-guid instance.
     1696
     1697<procedure>(sdl-joystick-guid? obj) → boolean</procedure>
     1698
     1699Returns #t if {{obj}} is a sdl-joystick-guid.
     1700
    11301701
    11311702
     
    11351706[[https://wiki.libsdl.org/SDL_Keysym|SDL_Keysym]] struct.
    11361707
    1137 <procedure>(sdl-keysym? x) → boolean</procedure>
    1138 
    1139 Returns #t if x is a sdl-keysym instance.
     1708
     1709<procedure>(sdl-keysym? obj) → boolean</procedure>
     1710
     1711Returns #t if {{obj}} is a sdl-keysym.
     1712
    11401713
    11411714<procedure>(sdl-alloc-keysym) → sdl-keysym</procedure>
     
    11461719memory will automatically be freed when the record instance is garbage
    11471720collected. It is not necessary to call {{sdl-free-keysym!}}, although
    1148 it is safe to do so.
     1721it is safe (and sometimes useful) to do so.
     1722
    11491723
    11501724<procedure>(sdl-alloc-keysym*) → sdl-keysym</procedure>
     
    11541728automatically freed when the instance is garbage collected. You must
    11551729manually call {{sdl-free-keysym!}} on the record instance when you are
    1156 done with it; otherwise, your program will have a memory leak.
     1730done with it; otherwise, your program will leak memory.
     1731
    11571732
    11581733<procedure>(sdl-free-keysym! keysym)</procedure>
     
    11641739to free an instance that has already been freed.
    11651740
     1741
    11661742<procedure>(sdl-keysym-scancode keysym) → symbol</procedure>
    11671743<setter>(set! (sdl-keysym-scancode keysym) val)</setter>
    11681744<setter>(sdl-keysym-scancode-set! keysym)</setter>
    11691745
     1746TODO: Docs.
     1747Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]].
     1748
     1749
    11701750<procedure>(sdl-keysym-scancode-raw keysym) → fixnum</procedure>
    11711751<setter>(set! (sdl-keysym-scancode-raw keysym) val)</setter>
    11721752<setter>(sdl-keysym-scancode-raw-set! keysym)</setter>
    11731753
     1754TODO: Docs.
     1755See also {{sdl-keysym-scancode}}.
     1756
     1757
    11741758<procedure>(sdl-keysym-sym keysym) → symbol</procedure>
    11751759<setter>(set! (sdl-keysym-sym keysym) val)</setter>
    11761760<setter>(sdl-keysym-sym-set! keysym)</setter>
    11771761
     1762TODO: Docs.
     1763Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-keycodes|keyboard keycode symbol]].
     1764
     1765
    11781766<procedure>(sdl-keysym-sym-raw keysym) → fixnum</procedure>
    11791767<setter>(set! (sdl-keysym-sym-raw keysym) val)</setter>
    11801768<setter>(sdl-keysym-sym-raw-set! keysym)</setter>
    11811769
     1770TODO: Docs.
     1771See also {{sdl-keysym-sym}}.
     1772
     1773
    11821774<procedure>(sdl-keysym-mod keysym) → list of symbols</procedure>
    11831775<setter>(set! (sdl-keysym-mod keysym) val)</setter>
    11841776<setter>(sdl-keysym-mod-set! keysym)</setter>
    11851777
     1778TODO: Docs.
     1779Returns a list of zero or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-modifiers|keyboard modifier symbols]].
     1780
     1781
    11861782<procedure>(sdl-keysym-mod-raw keysym) → fixnum</procedure>
    11871783<setter>(set! (sdl-keysym-mod-raw keysym) val)</setter>
    11881784<setter>(sdl-keysym-mod-raw-set! keysym)</setter>
    11891785
     1786TODO: Docs.
     1787See also {{sdl-keysym-mod}}.
     1788
     1789
    11901790
    11911791==== sdl-palette
     
    11941794[[https://wiki.libsdl.org/SDL_Palette|SDL_Palette]] struct.
    11951795
    1196 <procedure>(sdl-palette? x) → boolean</procedure>
    1197 
    1198 Returns #t if x is a sdl-palette instance.
     1796
     1797<procedure>(sdl-palette? obj) → boolean</procedure>
     1798
     1799Returns #t if {{obj}} is a sdl-palette.
     1800
    11991801
    12001802<procedure>(sdl-alloc-palette ncolors)</procedure>
     
    12051807memory will automatically be freed when the record instance is garbage
    12061808collected. It is not necessary to call {{sdl-free-palette!}}, although
    1207 it is safe to do so.
     1809it is safe (and sometimes useful) to do so.
     1810
    12081811
    12091812<procedure>(sdl-alloc-palette*)</procedure>
     
    12131816automatically freed when the instance is garbage collected. You must
    12141817manually call {{sdl-free-palette!}} on the record instance when you
    1215 are done with it; otherwise, your program will have a memory leak.
     1818are done with it; otherwise, your program will leak memory.
     1819
    12161820
    12171821<procedure>(sdl-free-palette! palette)</procedure>
     
    12231827to free an instance that has already been freed.
    12241828
     1829
    12251830<procedure>(sdl-palette-ncolors palette) → fixnum</procedure>
     1831
     1832Returns the number of colors in the palette. May be as high as 256.
     1833
    12261834
    12271835
     
    12311839[[https://wiki.libsdl.org/SDL_PixelFormat|SDL_PixelFormat]] struct.
    12321840
    1233 <procedure>(sdl-pixel-format? x) → boolean</procedure>
    1234 
    1235 Returns #t if x is a sdl-pixel-format instance.
     1841
     1842<procedure>(sdl-pixel-format? obj) → boolean</procedure>
     1843
     1844Returns #t if {{obj}} is a sdl-pixel-format.
     1845
    12361846
    12371847<procedure>(sdl-alloc-pixel-format pixel-format-enum) → sdl-pixel-format</procedure>
     
    12421852memory will automatically be freed when the record instance is garbage
    12431853collected. It is not necessary to call {{sdl-free-pixel-format!}},
    1244 although it is safe to do so.
     1854although it is safe (and sometimes useful) to do so.
     1855
    12451856
    12461857<procedure>(sdl-alloc-pixel-format* pixel-format-enum) → sdl-pixel-format</procedure>
     
    12531864leak.
    12541865
     1866
    12551867<procedure>(sdl-free-pixel-format! pixel-format)</procedure>
    12561868
     
    12611873to free an instance that has already been freed.
    12621874
     1875
    12631876<procedure>(sdl-pixel-format-format pixel-format) → symbol</procedure>
     1877
     1878TODO: Docs.
     1879Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#pixel-formats|pixel format symbol]].
     1880
     1881
    12641882<procedure>(sdl-pixel-format-format-raw pixel-format) → fixnum</procedure>
    12651883
    1266 <procedure>(sdl-pixel-format-palette pixel-format) → sdl-palette</procedure>
     1884TODO: Docs.
     1885See also {{sdl-pixel-format-format}}.
     1886
     1887
     1888<procedure>(sdl-pixel-format-palette pixel-format) → sdl-palette or #f</procedure>
    12671889<setter>(set! (sdl-pixel-format-palette pixel-format) val)</setter>
    12681890<setter>(sdl-pixel-format-palette-set! pixel-format palette)</setter>
    12691891
     1892Returns the pixel format's palette (as a sdl-palette), or #f if it
     1893does not have a palette. Only pixel formats with a bits-per-pixel of 8
     1894or less can have a palette.
     1895
     1896
    12701897<procedure>(sdl-pixel-format-bits-per-pixel pixel-format) → fixnum</procedure>
     1898
     1899TODO: Docs
     1900
     1901
    12711902<procedure>(sdl-pixel-format-bytes-per-pixel pixel-format) → fixnum</procedure>
     1903
     1904TODO: Docs
     1905
     1906
    12721907<procedure>(sdl-pixel-format-rmask pixel-format) → fixnum</procedure>
     1908
     1909TODO: Docs
     1910
     1911
    12731912<procedure>(sdl-pixel-format-gmask pixel-format) → fixnum</procedure>
     1913
     1914TODO: Docs
     1915
     1916
    12741917<procedure>(sdl-pixel-format-bmask pixel-format) → fixnum</procedure>
     1918
     1919TODO: Docs
     1920
     1921
    12751922<procedure>(sdl-pixel-format-amask pixel-format) → fixnum</procedure>
     1923
     1924TODO: Docs.
     1925
    12761926
    12771927
     
    12811931[[https://wiki.libsdl.org/SDL_Point|SDL_Point]] struct.
    12821932
    1283 <procedure>(sdl-point? x) → boolean</procedure>
    1284 
    1285 Returns #t if x is a sdl-point instance.
     1933
     1934<procedure>(sdl-point? obj) → boolean</procedure>
     1935
     1936Returns #t if {{obj}} is a sdl-point.
     1937
    12861938
    12871939<procedure>(sdl-make-point #!optional x y)</procedure>
     
    12971949default to 0.
    12981950
     1951
    12991952<procedure>(sdl-alloc-point) → sdl-point</procedure>
    13001953
     
    13051958memory will automatically be freed when the record instance is garbage
    13061959collected. It is not necessary to call {{sdl-free-point!}}, although
    1307 it is safe to do so.
     1960it is safe (and sometimes useful) to do so.
     1961
    13081962
    13091963<procedure>(sdl-alloc-point*) → sdl-point</procedure>
     
    13131967automatically freed when the instance is garbage collected. You must
    13141968manually call {{sdl-free-point!}} on the record instance when you are
    1315 done with it; otherwise, your program will have a memory leak.
     1969done with it; otherwise, your program will leak memory.
     1970
    13161971
    13171972<procedure>(sdl-free-point! point)</procedure>
     
    13231978to free an instance that has already been freed.
    13241979
     1980
    13251981<procedure>(sdl-point-x point) → fixnum</procedure>
    13261982<setter>(set! (sdl-point-x point) x)</setter>
     
    13301986-2147483648 to 2147483647 (inclusive).
    13311987
     1988
    13321989<procedure>(sdl-point-y point) → fixnum</procedure>
    13331990<setter>(set! (sdl-point-y point) y)</setter>
     
    13361993Get or set the "y" field of the sdl-point, as an integer in the range
    13371994-2147483648 to 2147483647 (inclusive).
     1995
    13381996
    13391997<procedure>(sdl-point-set! point #!optional x y) → point</procedure>
     
    13442002{{point}} after it is modified.
    13452003
     2004
    13462005<procedure>(sdl-point->list point) → list of fixnums</procedure>
    13472006
    13482007Returns a list {{(x y)}} containing the fields of the sdl-point.
     2008
    13492009
    13502010
     
    13542014[[https://wiki.libsdl.org/SDL_Rect|SDL_Rect]] struct.
    13552015
    1356 <procedure>(sdl-rect? x) → boolean</procedure>
    1357 
    1358 Returns #t if x is a sdl-rect instance.
     2016
     2017<procedure>(sdl-rect? obj) → boolean</procedure>
     2018
     2019Returns #t if {{obj}} is a sdl-rect.
     2020
    13592021
    13602022<procedure>(sdl-make-rect #!optional x y w h)</procedure>
     
    13702032all default to 0.
    13712033
     2034
    13722035<procedure>(sdl-alloc-rect)</procedure>
    13732036
     
    13802043is safe to do so.
    13812044
     2045
    13822046<procedure>(sdl-alloc-rect*)</procedure>
    13832047
     
    13862050automatically freed when the instance is garbage collected. You must
    13872051manually call {{sdl-free-rect!}} on the record instance when you are
    1388 done with it; otherwise, your program will have a memory leak.
     2052done with it; otherwise, your program will leak memory.
     2053
    13892054
    13902055<procedure>(sdl-free-rect! rect)</procedure>
     
    13962061to free an instance that has already been freed.
    13972062
     2063
    13982064<procedure>(sdl-rect-x rect)</procedure>
    13992065<setter>(set! (sdl-rect-x rect) x)</setter>
     
    14032069-2147483648 to 2147483647 (inclusive).
    14042070
     2071
    14052072<procedure>(sdl-rect-y rect)</procedure>
    14062073<setter>(set! (sdl-rect-y rect) y)</setter>
     
    14102077-2147483648 to 2147483647 (inclusive).
    14112078
     2079
    14122080<procedure>(sdl-rect-w rect)</procedure>
    14132081<setter>(set! (sdl-rect-w rect) w)</setter>
     
    14172085range -2147483648 to 2147483647 (inclusive).
    14182086
     2087
    14192088<procedure>(sdl-rect-h rect)</procedure>
    14202089<setter>(set! (sdl-rect-h rect) h)</setter>
     
    14232092Get or set the "h" (height) field of the sdl-rect, as an integer in
    14242093the range -2147483648 to 2147483647 (inclusive).
     2094
    14252095
    14262096<procedure>(sdl-rect-set! rect #!optional x y w h)</procedure>
     
    14312101{{rect}} after it is modified.
    14322102
     2103
    14332104<procedure>(sdl-rect->list rect)</procedure>
    14342105
    14352106Returns a list {{(x y w h)}} containing the fields of the sdl-rect.
     2107
    14362108
    14372109
     
    14412113[[https://wiki.libsdl.org/SDL_RWops|SDL_RWops]] struct.
    14422114
    1443 <procedure>(sdl-rwops? x) → boolean</procedure>
    1444 
    1445 Returns #t if x is a sdl-rwops instance.
     2115
     2116<procedure>(sdl-rwops? obj) → boolean</procedure>
     2117
     2118Returns #t if {{obj}} is a sdl-rwops.
     2119
    14462120
    14472121<procedure>(sdl-rwops-type rwops) → symbol</procedure>
     2122
     2123TODO: Docs
     2124
     2125
    14482126<procedure>(sdl-rwops-type-raw rwops) → fixnum</procedure>
     2127
     2128TODO: Docs.
     2129
    14492130
    14502131
     
    14542135[[https://wiki.libsdl.org/SDL_Surface|SDL_Surface]] struct.
    14552136
    1456 <procedure>(sdl-surface? x) → boolean</procedure>
    1457 
    1458 Returns #t if x is a sdl-surface instance.
     2137
     2138<procedure>(sdl-surface? obj) → boolean</procedure>
     2139
     2140Returns #t if {{obj}} is a sdl-surface.
     2141
    14592142
    14602143<procedure>(sdl-free-surface! surface)</procedure>
     
    14682151to free an instance that has already been freed.
    14692152
     2153
    14702154<procedure>(sdl-surface-format surface) → sdl-pixel-format</procedure>
    14712155
     2156TODO: Docs.
     2157
     2158
    14722159<procedure>(sdl-surface-w surface) → fixnum</procedure>
    14732160
     2161TODO: Docs.
     2162
     2163
    14742164<procedure>(sdl-surface-h surface) → fixnum</procedure>
    14752165
     2166TODO: Docs.
     2167
     2168
    14762169<procedure>(sdl-surface-pitch surface) → fixnum</procedure>
     2170
     2171TODO: Docs.
     2172
    14772173
    14782174<procedure>(sdl-surface-refcount surface) → fixnum</procedure>
     
    14802176<setter>(sdl-surface-refcount-set! surface)</setter>
    14812177
     2178TODO: Docs.
     2179
     2180
    14822181
    14832182==== sdl-sys-wm-info
     
    14862185[[https://wiki.libsdl.org/SDL_SysWMinfo|SDL_SysWMinfo]] struct.
    14872186
    1488 <procedure>(sdl-sys-wm-info? x) → boolean</procedure>
    1489 
    1490 Returns #t if x is a sdl-sys-wm-info instance.
     2187
     2188<procedure>(sdl-sys-wm-info? obj) → boolean</procedure>
     2189
     2190Returns #t if {{obj}} is a sdl-sys-wm-info.
     2191
    14912192
    14922193
     
    14962197[[https://wiki.libsdl.org/SDL_SysWMmsg|SDL_SysWMmsg]] struct.
    14972198
    1498 <procedure>(sdl-sys-wm-msg? x) → boolean</procedure>
    1499 
    1500 Returns #t if x is a sdl-sys-wm-msg instance.
     2199
     2200<procedure>(sdl-sys-wm-msg? obj) → boolean</procedure>
     2201
     2202Returns #t if {{obj}} is a sdl-sys-wm-msg.
     2203
    15012204
    15022205
     
    15062209[[https://wiki.libsdl.org/SDL_Texture|SDL_Texture]] struct.
    15072210
    1508 <procedure>(sdl-texture? x) → boolean</procedure>
    1509 
    1510 Returns #t if x is a sdl-texture instance.
     2211
     2212<procedure>(sdl-texture? obj) → boolean</procedure>
     2213
     2214Returns #t if {{obj}} is a sdl-texture.
     2215
    15112216
    15122217
     
    15162221[[https://wiki.libsdl.org/SDL_version|SDL_version]] struct.
    15172222
    1518 <procedure>(sdl-version? x) → boolean</procedure>
    1519 
    1520 Returns #t if x is a sdl-version instance.
     2223
     2224<procedure>(sdl-version? obj) → boolean</procedure>
     2225
     2226Returns #t if {{obj}} is a sdl-version.
     2227
    15212228
    15222229<procedure>(sdl-make-version #!optional major minor patch)</procedure>
     
    15322239default to 0.
    15332240
     2241
    15342242<procedure>(sdl-alloc-version)</procedure>
    15352243
     
    15402248memory will automatically be freed when the record instance is garbage
    15412249collected. It is not necessary to call {{sdl-free-version!}}, although
    1542 it is safe to do so.
     2250it is safe (and sometimes useful) to do so.
     2251
    15432252
    15442253<procedure>(sdl-alloc-version*)</procedure>
     
    15482257automatically freed when the instance is garbage collected. You must
    15492258manually call {{sdl-free-version!}} on the record instance when you
    1550 are done with it; otherwise, your program will have a memory leak.
     2259are done with it; otherwise, your program will leak memory.
     2260
    15512261
    15522262<procedure>(sdl-free-version! version)</procedure>
     
    15582268to free an instance that has already been freed.
    15592269
     2270
    15602271<procedure>(sdl-version-major version)</procedure>
    15612272<setter>(set! (sdl-version-major version) major)</setter>
     
    15652276range 0 to 255 (inclusive).
    15662277
     2278
    15672279<procedure>(sdl-version-minor version)</procedure>
    15682280<setter>(set! (sdl-version-minor version) minor)</setter>
     
    15722284range 0 to 255 (inclusive).
    15732285
     2286
    15742287<procedure>(sdl-version-patch version)</procedure>
    15752288<setter>(set! (sdl-version-patch version) patch)</setter>
     
    15782291Get or set the "patch" field of the sdl-version, as an integer in the
    15792292range 0 to 255 (inclusive).
     2293
    15802294
    15812295<procedure>(sdl-version-set! version #!optional major minor patch)</procedure>
     
    15862300{{version}} after it is modified.
    15872301
     2302
    15882303<procedure>(sdl-version->list version)</procedure>
    15892304
     
    15922307
    15932308
     2309
    15942310==== sdl-window
    15952311
     
    15972313[[https://wiki.libsdl.org/SDL_CreateWindow|SDL_Window]] struct.
    15982314
    1599 <procedure>(sdl-window? x) → boolean</procedure>
    1600 
    1601 Returns #t if x is a sdl-window instance.
     2315
     2316<procedure>(sdl-window? obj) → boolean</procedure>
     2317
     2318Returns #t if {{obj}} is a sdl-window.
     2319
    16022320
    16032321
     
    16062324==== General / Miscellaneous
    16072325
    1608 <procedure>(sdl-init! flags) → fixnum</procedure>
     2326<procedure>(sdl-init! flags-list) → fixnum</procedure>
    16092327
    16102328See [[https://wiki.libsdl.org/SDL_Init|SDL_Init]].
    16112329Returns zero if successful.
    16122330
    1613 <procedure>(sdl-init-subsystem! flags) → fixnum</procedure>
     2331{{flags-list}} must be a list of one or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#init-flags|init flag symbols]]:
     2332
     2333* {{'timer}}
     2334* {{'audio}}
     2335* {{'video}}
     2336* {{'joystick}}
     2337* {{'haptic}}
     2338* {{'game-controller}}
     2339* {{'events}}
     2340* {{'everything}}
     2341
     2342
     2343<procedure>(sdl-init-subsystem! flags-list) → fixnum</procedure>
    16142344
    16152345See [[https://wiki.libsdl.org/SDL_InitSubSystem|SDL_InitSubSystem]].
    16162346Returns zero if successful.
    16172347
     2348{{flags-list}} must be a list of one or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#init-flags|init flag]] symbols.
     2349
     2350
    16182351<procedure>(sdl-quit!)</procedure>
    16192352
    16202353See [[https://wiki.libsdl.org/SDL_Quit|SDL_Quit]].
    16212354
    1622 <procedure>(sdl-quit-subsystem! flags)</procedure>
     2355
     2356<procedure>(sdl-quit-subsystem! flags-list)</procedure>
    16232357
    16242358See [[https://wiki.libsdl.org/SDL_QuitSubSystem|SDL_QuitSubSystem]].
    16252359
    1626 <procedure>(sdl-was-init flags) → list of symbols</procedure>
     2360{{flags-list}} must be a list of one or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#init-flags|init flag]] symbols.
     2361
     2362
     2363<procedure>(sdl-was-init flags-list) → list of symbols</procedure>
    16272364
    16282365See [[https://wiki.libsdl.org/SDL_WasInit|SDL_WasInit]].
    16292366
     2367{{flags-list}} must be a list of one or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#init-flags|init flag]] symbols.
     2368
     2369
    16302370<procedure>(sdl-set-main-ready!)</procedure>
    16312371
    16322372See [[https://wiki.libsdl.org/SDL_SetMainReady|SDL_SetMainReady]].
    16332373
     2374
    16342375<procedure>(sdl-clear-error!)</procedure>
    16352376
    16362377See [[https://wiki.libsdl.org/SDL_ClearError|SDL_ClearError]].
    16372378
     2379
    16382380<procedure>(sdl-get-error) → string</procedure>
    16392381
    16402382See [[https://wiki.libsdl.org/SDL_GetError|SDL_GetError]].
    16412383
     2384
    16422385<procedure>(sdl-set-error! message)</procedure>
    16432386
    16442387See [[https://wiki.libsdl.org/SDL_SetError|SDL_SetError]].
    16452388
     2389Unlike SDL_SetError, this procedure only accepts one argument, a
     2390string. You can use {{sprintf}} to do string substitution if desired.
     2391
     2392
    16462393<procedure>(sdl-get-platform) → string</procedure>
    16472394
    16482395See [[https://wiki.libsdl.org/SDL_GetPlatform|SDL_GetPlatform]].
    16492396
     2397
    16502398<procedure>(sdl-disable-screen-saver!)</procedure>
    16512399
    16522400See [[https://wiki.libsdl.org/SDL_DisableScreenSaver|SDL_DisableScreenSaver]].
    16532401
     2402
    16542403<procedure>(sdl-enable-screen-saver!)</procedure>
    16552404
    16562405See [[https://wiki.libsdl.org/SDL_EnableScreenSaver|SDL_EnableScreenSaver]].
    16572406
     2407
    16582408<procedure>(sdl-screen-saver-enabled?) → boolean</procedure>
    16592409
    16602410See [[https://wiki.libsdl.org/SDL_IsScreenSaverEnabled|SDL_IsScreenSaverEnabled]].
    16612411
     2412
    16622413<procedure>(sdl-has-clipboard-text?) → boolean</procedure>
    16632414
    16642415See [[https://wiki.libsdl.org/SDL_HasClipboardText|SDL_HasClipboardText]].
    16652416
     2417
    16662418<procedure>(sdl-get-clipboard-text) → string</procedure>
    16672419
    16682420See [[https://wiki.libsdl.org/SDL_GetClipboardText|SDL_GetClipboardText]].
     2421
    16692422
    16702423<procedure>(sdl-set-clipboard-text! text) → fixnum</procedure>
     
    16722425See [[https://wiki.libsdl.org/SDL_SetClipboardText|SDL_SetClipboardText]].
    16732426Returns zero if successful.
     2427
    16742428
    16752429<procedure>(sdl-get-version) → sdl-version</procedure>
     
    16812435version it was compiled with.)
    16822436
     2437
    16832438<procedure>(sdl-get-compiled-version) → sdl-version</procedure>
    16842439
     
    16882443that the sdl2 egg was compiled with. (This may be different than the
    16892444version it is currently using.)
     2445
    16902446
    16912447<procedure>(sdl-version-at-least? major minor patch) → boolean</procedure>
     
    17002456
    17012457
     2458
    17022459==== Pixel Format / Palette
    17032460
     
    17062463See [[https://wiki.libsdl.org/SDL_MapRGB|SDL_MapRGB]].
    17072464
     2465
    17082466<procedure>(sdl-map-rgba pixel-format r g b a) → fixnum</procedure>
    17092467
    17102468See [[https://wiki.libsdl.org/SDL_MapRGBA|SDL_MapRGBA]].
    17112469
     2470
    17122471<procedure>(sdl-get-rgb pixel pixel-format) → [r g b]</procedure>
    17132472
     
    17162475Returns multiple values.
    17172476
     2477
    17182478<procedure>(sdl-get-rgba pixel pixel-format) → [r g b a]</procedure>
    17192479
     
    17222482Returns multiple values.
    17232483
     2484
    17242485<procedure>(sdl-palette-ref palette i) → sdl-color</procedure>
    17252486
    17262487Return the sdl-color at the given index of the palette.
     2488
    17272489
    17282490<setter>(set! (sdl-palette-ref palette i) color)</setter>
     
    17312493Set the given index of the palette to the given sdl-color.
    17322494
     2495
    17332496<procedure>(sdl-palette-colors palette) → vector of sdl-colors </procedure>
    17342497
    17352498Return a vector of all the colors in the palette.
    17362499
     2500
    17372501<setter>(sdl-palette-colors-set! colors-vec #!optional start) -> fixnum</setter>
    17382502
     
    17442508
    17452509
     2510
    17462511==== Events
    17472512
     
    17502515See [[https://wiki.libsdl.org/SDL_EventState|SDL_EventState]].
    17512516
    1752 Like SDL_EventState with SDL_QUERY
     2517Like calling SDL_EventState with SDL_QUERY. {{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
     2518
    17532519
    17542520<setter>(set! (sdl-event-state type) state) → boolean</setter>
     
    17572523See [[https://wiki.libsdl.org/SDL_EventState|SDL_EventState]].
    17582524
    1759 Like SDL_EventState with SDL_ENABLE or SDL_IGNORE
    1760 
    1761 Returns the previous state of this event type.
     2525Like calling SDL_EventState with SDL_ENABLE or SDL_IGNORE.
     2526
     2527Returns the previous state of the given event type.
     2528
     2529{{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
     2530
    17622531
    17632532<procedure>(sdl-flush-event! type)</procedure>
     
    17682537ALL events matching the given type, not just a single event.
    17692538
     2539{{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
     2540
     2541
    17702542<procedure>(sdl-flush-events! min-type max-type)</procedure>
    17712543
    17722544See [[https://wiki.libsdl.org/SDL_FlushEvents|SDL_FlushEvents]].
    17732545
     2546{{min-type}} and {{max-type}} must be [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbols]] or corresponding integers.
     2547
     2548
    17742549<procedure>(sdl-has-event? type) → boolean</procedure>
    17752550
    17762551See [[https://wiki.libsdl.org/SDL_HasEvent|SDL_HasEvent]].
    17772552
     2553{{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
     2554
     2555
    17782556<procedure>(sdl-has-events? min-type max-type) → boolean</procedure>
    17792557
    17802558See [[https://wiki.libsdl.org/SDL_HasEvents|SDL_HasEvents]].
    17812559
     2560{{min-type}} and {{max-type}} must be [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbols]] or corresponding integers.
     2561
     2562
    17822563<procedure>(sdl-quit-requested?) → boolean</procedure>
    17832564
    17842565See [[https://wiki.libsdl.org/SDL_QuitRequested|SDL_QuitRequested]].
     2566
    17852567
    17862568<procedure>(sdl-peek-events num #!optional min-type max-type) → list of sdl-events</procedure>
     
    17932575procedure removes the events from the SDL event queue.
    17942576
     2577{{min-type}} and {{max-type}} must be [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbols]] or corresponding integers.
     2578
     2579
    17952580<procedure>(sdl-get-events! num #!optional min-type max-type) → list of sdl-events</procedure>
    17962581
     
    18012586This procedure is similar to {{sdl-peek-events}}, except that
    18022587procedure does not remove the events from the SDL event queue.
     2588
     2589{{min-type}} and {{max-type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
     2590
    18032591
    18042592<procedure>(sdl-poll-event! #!optional event) → sdl-event</procedure>
     
    18122600much garbage for the garbage collector.)
    18132601
     2602
    18142603<procedure>(sdl-pump-events!)</procedure>
    18152604
    18162605See [[https://wiki.libsdl.org/SDL_PumpEvents|SDL_PumpEvents]].
    18172606
     2607
    18182608<procedure>(sdl-push-event! event) → fixnum</procedure>
    18192609
     
    18212611
    18222612Returns 1 if successful.
     2613
    18232614
    18242615<procedure>(sdl-wait-event! #!optional event) → event </procedure>
     
    18322623much garbage for the garbage collector.)
    18332624
     2625
    18342626<procedure>(sdl-wait-event-timeout! timeout #!optional event) → event</procedure>
    18352627
     
    18442636Please note that the argument order is reversed compared to SDL_WaitEventTimeout. This is to allow the event argument to be optional.
    18452637
     2638
    18462639<procedure>(sdl-register-events! numevents) → fixnum</procedure>
    18472640
    18482641See [[https://wiki.libsdl.org/SDL_RegisterEvents|SDL_RegisterEvents]].
    18492642
     2643
    18502644<procedure>(sdl-get-num-touch-devices) → fixnum</procedure>
    18512645
    18522646See [[https://wiki.libsdl.org/SDL_GetNumTouchDevices|SDL_GetNumTouchDevices]].
    18532647
     2648
    18542649<procedure>(sdl-get-num-touch-fingers touch-id) → fixnum</procedure>
    18552650
    18562651See [[https://wiki.libsdl.org/SDL_GetNumTouchFingers|SDL_GetNumTouchFingers]].
    18572652
     2653
    18582654<procedure>(sdl-get-touch-device device-id) → fixnum</procedure>
    18592655
    18602656See [[https://wiki.libsdl.org/SDL_GetTouchDevice|SDL_GetTouchDevice]].
    18612657
     2658
    18622659<procedure>(sdl-get-touch-finger touch-id index) → sdl-finger</procedure>
    18632660
     
    18652662
    18662663
     2664
    18672665==== OpenGL integration
    18682666
     
    18712669See [[https://wiki.libsdl.org/SDL_GL_CreateContext|SDL_GL_CreateContext]].
    18722670
     2671
    18732672<procedure>(sdl-gl-delete-context! gl-context)</procedure>
    18742673
    18752674See [[https://wiki.libsdl.org/SDL_GL_DeleteContext|SDL_GL_DeleteContext]].
    18762675
     2676
    18772677<procedure>(sdl-gl-make-current! window gl-context) → fixnum</procedure>
    18782678
    18792679See [[https://wiki.libsdl.org/SDL_GL_MakeCurrent|SDL_GL_MakeCurrent]].
    18802680
     2681
    18812682<procedure>(sdl-gl-get-current-window) → sdl-window</procedure>
    18822683
    18832684See [[https://wiki.libsdl.org/SDL_GL_GetCurrentWindow|SDL_GL_GetCurrentWindow]].
    18842685
     2686
    18852687<procedure>(sdl-gl-get-current-context) → sdl-gl-context</procedure>
    18862688
    18872689See [[https://wiki.libsdl.org/SDL_GL_GetCurrentContext|SDL_GL_GetCurrentContext]].
    18882690
     2691
    18892692<procedure>(sdl-gl-get-attribute attr) → value</procedure>
    18902693
    18912694See [[https://wiki.libsdl.org/SDL_GL_GetAttribute|SDL_GL_GetAttribute]].
     2695
     2696{{attr}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#opengl-attributes|OpenGL attribute symbol]] or corresponding integer.
     2697
     2698The return type varies depending on {{attr}}:
     2699
     2700* If {{attr}} is {{'context-profile-mask}}, an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#opengl-profiles|OpenGL profile symbol]] will be returned.
     2701
     2702* If {{attr}} is {{'context-flags}}, a list of zero or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#opengl-context-flags|OpenGL context flag symbols]] will be returned.
     2703
     2704* Otherwise, an integer will be returned.
     2705
    18922706
    18932707<procedure>(sdl-gl-set-attribute! attr value) → fixnum</procedure>
     
    18952709See [[https://wiki.libsdl.org/SDL_GL_SetAttribute|SDL_GL_SetAttribute]].
    18962710Returns zero if successful.
     2711
     2712{{attr}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#opengl-attributes|OpenGL attribute symbol]] or corresponding integer.
     2713
     2714{{value}} must be one of these types, depending on what {{attr}} is:
     2715
     2716* If {{attr}} is {{'context-profile-mask}}, {{value}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#opengl-profiles|OpenGL profile symbol]] or corresponding integer.
     2717
     2718* If {{attr}} is {{'context-flags}}, {{value}} must be a list of zero or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#opengl-context-flags|OpenGL context flag symbols]] or an integer bitfield.
     2719
     2720* Otherwise, {{value}} must be an integer.
     2721
    18972722
    18982723<procedure>(sdl-gl-reset-attributes!)</procedure>
     
    19042729check before calling this procedure.
    19052730
     2731
    19062732<procedure>(sdl-gl-get-drawable-size window) → [w h]</procedure>
    19072733
     
    19132739check before calling this procedure.
    19142740
     2741
    19152742<procedure>(sdl-gl-swap-window!)</procedure>
    19162743
    19172744See [[https://wiki.libsdl.org/SDL_GL_SwapWindow|SDL_GL_SwapWindow]].
    19182745
     2746
    19192747<procedure>(sdl-gl-get-swap-interval) → fixnum</procedure>
    19202748
    19212749See [[https://wiki.libsdl.org/SDL_GL_GetSwapInterval|SDL_GL_GetSwapInterval]].
     2750
    19222751
    19232752<procedure>(sdl-gl-set-swap-interval! interval) → fixnum</procedure>
     
    19262755Returns zero if successful
    19272756
     2757
    19282758<procedure>(sdl-gl-extension-supported? name-string) → boolean</procedure>
    19292759
     
    19312761
    19322762
     2763
    19332764==== Joystick
    19342765
     
    19372768See [[https://wiki.libsdl.org/SDL_NumJoysticks|SDL_NumJoysticks]].
    19382769
     2770
    19392771<procedure>(sdl-joystick-open! index) → sdl-joystick</procedure>
    19402772
    19412773See [[https://wiki.libsdl.org/SDL_JoystickOpen|SDL_JoystickOpen]].
    19422774
     2775
    19432776<procedure>(sdl-joystick-close! joystick)</procedure>
    19442777
    19452778See [[https://wiki.libsdl.org/SDL_JoystickClose|SDL_JoystickClose]].
    19462779
     2780
    19472781<procedure>(sdl-joystick-update!)</procedure>
    19482782
    19492783See [[https://wiki.libsdl.org/SDL_JoystickUpdate|SDL_JoystickUpdate]].
    19502784
     2785
    19512786<procedure>(sdl-joystick-event-state) → boolean</procedure>
    19522787
     
    19542789
    19552790Like SDL_JoystickEventState with SDL_QUERY.
     2791
    19562792
    19572793<setter>(set! (sdl-joystick-event-state) state) → boolean</setter>
     
    19622798Like SDL_JoystickEventState with SDL_ENABLE or SDL_IGNORE
    19632799
     2800
    19642801<procedure>(sdl-joystick-attached? joystick) → boolean</procedure>
    19652802
    19662803See [[https://wiki.libsdl.org/SDL_JoystickGetAttached|SDL_JoystickGetAttached]].
    19672804
     2805
    19682806<procedure>(sdl-joystick-num-axes joystick) → fixnum</procedure>
    19692807
    19702808See [[https://wiki.libsdl.org/SDL_JoystickNumAxes|SDL_JoystickNumAxes]].
    19712809
     2810
    19722811<procedure>(sdl-joystick-num-balls joystick) → fixnum</procedure>
    19732812
    19742813See [[https://wiki.libsdl.org/SDL_JoystickNumBalls|SDL_JoystickNumBalls]].
    19752814
     2815
    19762816<procedure>(sdl-joystick-num-buttons joystick) → fixnum</procedure>
    19772817
    19782818See [[https://wiki.libsdl.org/SDL_JoystickNumButtons|SDL_JoystickNumButtons]].
    19792819
     2820
    19802821<procedure>(sdl-joystick-num-hats joystick) → fixnum</procedure>
    19812822
    19822823See [[https://wiki.libsdl.org/SDL_JoystickNumHats|SDL_JoystickNumHats]].
    19832824
     2825
    19842826<procedure>(sdl-joystick-get-axis joystick axis-num) → fixnum</procedure>
    19852827
    19862828See [[https://wiki.libsdl.org/SDL_JoystickGetAxis|SDL_JoystickGetAxis]].
    19872829
     2830
    19882831<procedure>(sdl-joystick-get-ball joystick ball-num) → [dx dy]</procedure>
    19892832
     
    19922835Returns multiple values.
    19932836
     2837
    19942838<procedure>(sdl-joystick-get-button joystick button-num) → boolean</procedure>
    19952839
    19962840See [[https://wiki.libsdl.org/SDL_JoystickGetButton|SDL_JoystickGetButton]].
    19972841
     2842
    19982843<procedure>(sdl-joystick-get-hat joystick hat-num) → symbol</procedure>
    19992844
    20002845See [[https://wiki.libsdl.org/SDL_JoystickGetHat|SDL_JoystickGetHat]].
    20012846
     2847
    20022848<procedure>(sdl-joystick-get-hat-raw joystick hat-num) → fixnum</procedure>
    20032849
    20042850See [[https://wiki.libsdl.org/SDL_JoystickGetHat|SDL_JoystickGetHat]].
     2851See also {{sdl-joystick-get-hat}}.
    20052852
    20062853<procedure>(sdl-joystick-instance-id joystick) → fixnum</procedure>
     
    20082855See [[https://wiki.libsdl.org/SDL_JoystickInstanceID|SDL_JoystickInstanceID]].
    20092856
     2857
    20102858<procedure>(sdl-joystick-name joystick) → string</procedure>
    20112859
    20122860See [[https://wiki.libsdl.org/SDL_JoystickName|SDL_JoystickName]].
    20132861
     2862
    20142863<procedure>(sdl-joystick-name-for-index device-index) → string</procedure>
    20152864
    20162865See [[https://wiki.libsdl.org/SDL_JoystickNameForIndex|SDL_JoystickNameForIndex]].
    20172866
     2867
    20182868<procedure>(sdl-joystick-get-device-guid device-index) → sdl-joystick-guid</procedure>
    20192869
    20202870See [[https://wiki.libsdl.org/SDL_JoystickGetDeviceGUID|SDL_JoystickGetDeviceGUID]].
    20212871
     2872
    20222873<procedure>(sdl-joystick-get-guid joystick) → sdl-joystick-guid</procedure>
    20232874
    20242875See [[https://wiki.libsdl.org/SDL_JoystickGetGUID|SDL_JoystickGetGUID]].
    20252876
     2877
    20262878<procedure>(sdl-joystick-get-guid-from-string str) → sdl-joystick-guid</procedure>
    20272879
    20282880See [[https://wiki.libsdl.org/SDL_JoystickGetGUIDFromString|SDL_JoystickGetGUIDFromString]].
    20292881
     2882
    20302883<procedure>(sdl-joystick-get-guid-string guid) → string</procedure>
    20312884
     
    20332886
    20342887
     2888
    20352889==== Keyboard
    20362890
     
    20392893See [[https://wiki.libsdl.org/SDL_GetKeyFromName|SDL_GetKeyFromName]].
    20402894
     2895Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-keycodes|keyboard keycode symbol]].
     2896
     2897
    20412898<procedure>(sdl-get-key-from-name-raw name-str) → fixnum</procedure>
    20422899
    20432900See [[https://wiki.libsdl.org/SDL_GetKeyFromName|SDL_GetKeyFromName]].
    20442901
     2902Returns an integer representing a keyboard keycode.
     2903See also {{sdl-get-key-from-name}}.
     2904
     2905
    20452906<procedure>(sdl-get-key-from-scancode scancode) → symbol</procedure>
    20462907
    20472908See [[https://wiki.libsdl.org/SDL_GetKeyFromScancode|SDL_GetKeyFromScancode]].
    20482909
     2910{{scancode}} must be a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]] or an integer representing a keyboard scancode.
     2911
     2912Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-keycodes|keyboard keycode symbol]].
     2913
     2914
    20492915<procedure>(sdl-get-key-from-scancode-raw scancode) → fixnum</procedure>
    20502916
    20512917See [[https://wiki.libsdl.org/SDL_GetKeyFromScancode|SDL_GetKeyFromScancode]].
    20522918
     2919{{scancode}} must be a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]] or an integer representing a keyboard scancode.
     2920
     2921Returns an integer representing a keyboard keycode.
     2922See also {{sdl-get-key-from-scancode}}.
     2923
     2924
    20532925<procedure>(sdl-get-key-name key) → string</procedure>
    20542926
    20552927See [[https://wiki.libsdl.org/SDL_GetKeyName|SDL_GetKeyName]].
    20562928
     2929{{key}} must be a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-keycodes|keyboard keycode symbol]] or an integer representing a keyboard keycode.
     2930
     2931
    20572932<procedure>(sdl-get-scancode-from-name name-str) → symbol</procedure>
    20582933
    20592934See [[https://wiki.libsdl.org/SDL_GetScancodeFromName|SDL_GetScancodeFromName]].
    20602935
     2936Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]].
     2937
     2938
    20612939<procedure>(sdl-get-scancode-from-name-raw name-str) → fixnum</procedure>
    20622940
    20632941See [[https://wiki.libsdl.org/SDL_GetScancodeFromName|SDL_GetScancodeFromName]].
    20642942
     2943Returns an integer representing a keyboard scancode.
     2944See also {{sdl-get-scancode-from-name}}.
     2945
     2946
    20652947<procedure>(sdl-get-scancode-from-key key) → symbol</procedure>
    20662948
    20672949See [[https://wiki.libsdl.org/SDL_GetScancodeFromKey|SDL_GetScancodeFromKey]].
    20682950
     2951{{key}} must be a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-keycodes|keyboard keycode symbol]] or an integer representing a keyboard keycode.
     2952
     2953Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]].
     2954
     2955
    20692956<procedure>(sdl-get-scancode-from-key-raw key) → fixnum</procedure>
    20702957
    20712958See [[https://wiki.libsdl.org/SDL_GetScancodeFromKey|SDL_GetScancodeFromKey]].
    20722959
     2960{{key}} must be a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-keycodes|keyboard keycode symbol]] or an integer representing a keyboard keycode.
     2961
     2962Returns an integer representing a keyboard scancode.
     2963See also {{sdl-get-scancode-from-key}}.
     2964
     2965
    20732966<procedure>(sdl-get-scancode-name scancode) → string</procedure>
    20742967
    20752968See [[https://wiki.libsdl.org/SDL_GetScancodeName|SDL_GetScancodeName]].
    20762969
     2970{{scancode}} must be a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]] or an integer representing a keyboard scancode.
     2971
     2972
    20772973<procedure>(sdl-get-keyboard-focus) → window</procedure>
    20782974
    20792975See [[https://wiki.libsdl.org/SDL_GetKeyboardFocus|SDL_GetKeyboardFocus]].
    20802976
     2977
    20812978<procedure>(sdl-keyboard-scancode-pressed? scancode) → boolean</procedure>
    20822979
    20832980Returns #t if the specified key is being pressed on the keyboard.
    2084 {{scancode}} can be either a symbol or an integer representing the
    2085 scancode of a keyboard key.
    2086 
    2087 This procedure queries SDL's internal state, which is connected to the
    2088 event system. Call sdl-pump-events! to update the keyboard state.
     2981
     2982{{scancode}} must be either a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-scancodes|keyboard scancode symbol]] or an integer representing the scancode of a keyboard key.
     2983
     2984This procedure queries SDL's internal state, which is tied to the
     2985event system. Call {{sdl-pump-events!}} to update the keyboard state.
    20892986
    20902987This procedure is based on
    20912988[[https://wiki.libsdl.org/SDL_GetKeyboardState|SDL_GetKeyboardState]].
    20922989
     2990
    20932991<procedure>(sdl-mod-state) → list of symbols </procedure>
    20942992
    20952993See [[https://wiki.libsdl.org/SDL_GetModState|SDL_GetModState]].
    20962994
     2995Returns a list of zero or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-modifiers|keyboard modifier symbols]].
     2996
     2997
    20972998<procedure>(sdl-mod-state-raw) → fixnum</procedure>
    20982999
    20993000See [[https://wiki.libsdl.org/SDL_GetModState|SDL_GetModState]].
     3001
     3002Returns an integer representing a bitfield of keyboard modifiers.
     3003See also {{sdl-mod-state}}.
     3004
    21003005
    21013006<setter>(set! (sdl-mod-state) state)</setter>
     
    21043009See [[https://wiki.libsdl.org/SDL_SetModState|SDL_SetModState]].
    21053010
    2106 State can be either a list of symbols or an integer bitfield.
     3011State can be either a list of [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#keyboard-modifiers|keyboard modifier symbols]] or an integer representing a bitfield of keyboard modifiers.
     3012
    21073013
    21083014<setter>(sdl-text-input-rect-set! rect)</setter>
     
    21123018See [[https://wiki.libsdl.org/SDL_SetTextInputRect|SDL_SetTextInputRect]].
    21133019
     3020
    21143021<procedure>(sdl-start-text-input!)</procedure>
    21153022
    21163023See [[https://wiki.libsdl.org/SDL_StartTextInput|SDL_StartTextInput]].
    21173024
     3025
    21183026<procedure>(sdl-stop-text-input!)</procedure>
    21193027
    21203028See [[https://wiki.libsdl.org/SDL_StopTextInput|SDL_StopTextInput]].
    21213029
     3030
    21223031<procedure>(sdl-text-input-active?) → boolean</procedure>
    21233032
    21243033See [[https://wiki.libsdl.org/SDL_IsTextInputActive|SDL_IsTextInputActive]].
    21253034
     3035
    21263036<procedure>(sdl-screen-keyboard-support?) → boolean</procedure>
    21273037
    21283038See [[https://wiki.libsdl.org/SDL_HasScreenKeyboardSupport|SDL_HasScreenKeyboardSupport]].
    21293039
     3040
    21303041<procedure>(sdl-screen-keyboard-shown? window) → boolean</procedure>
    21313042
     
    21333044
    21343045
     3046
    21353047==== Rect / Point
    21363048
     
    21393051See [[https://wiki.libsdl.org/SDL_RectEmpty|SDL_RectEmpty]].
    21403052
     3053
    21413054<procedure>(sdl-rect=? rect1 rect2) → boolean</procedure>
    21423055
    21433056See [[https://wiki.libsdl.org/SDL_RectEquals|SDL_RectEquals]].
    21443057
     3058
    21453059<procedure>(sdl-enclose-points points #!optional clip result-rect) → [any-enclosed? result-rect]</procedure>
    21463060
    21473061See [[https://wiki.libsdl.org/SDL_EnclosePoints|SDL_EnclosePoints]].
    21483062
    2149 {{points}} must be a list of sdl-points. {{clip}} is either a sdl-rect (to ignore points outside the clip rect) or #f (to consider all points). result-rect is either a sdl-rect (which will be modified and returned) or #f (a new sdl-rect will be returned).
     3063{{points}} must be a list of sdl-points. {{clip}} is either a sdl-rect
     3064(to ignore points outside the clip rect) or #f (to consider all
     3065points). {{result-rect}} is either a sdl-rect (which will be modified
     3066and returned) or #f (a new sdl-rect will be returned).
    21503067
    21513068This procedure returns multiple values:
    21523069
    21533070; any-enclosed? : #t if any points were enclosed, or #f if all points were clipped
    2154 ; result-rect : a sdl-rect instance that encloses all matching points. This is the same rect as result-rect (but modified), if that argument was given. Otherwise this is a newly allocated rect.
     3071; result-rect : a sdl-rect instance that encloses all matching points. If {{result-rect}} arg was given, that rect is modified and returned. Otherwise a newly allocated rect is returned.
     3072
    21553073
    21563074<procedure>(sdl-has-intersection? rect1 rect2) → boolean</procedure>
     
    21583076See [[https://wiki.libsdl.org/SDL_HasIntersection|SDL_HasIntersection]].
    21593077
     3078
    21603079<procedure>(sdl-intersect-rect rect1 rect2 #!optional result-rect) → [intersect? result-rect]</procedure>
    21613080
    21623081See [[https://wiki.libsdl.org/SDL_IntersectRect|SDL_IntersectRect]].
     3082
    21633083
    21643084<procedure>(sdl-intersect-rect-and-line rect x1 y1 x2 y2) → [intersect? x1-new y1-new x2-new y2-new]</procedure>
     
    21743094; y2-new : the y value ...
    21753095
     3096
    21763097<procedure>(sdl-union-rect rect1 rect2 #!optional result-rect) → result-rect</procedure>
    21773098
    21783099See [[https://wiki.libsdl.org/SDL_UnionRect|SDL_UnionRect]].
    21793100
     3101
     3102
    21803103==== RWops
    21813104
     
    21843107See [[https://wiki.libsdl.org/SDL_RWFromFile|SDL_RWFromFile]].
    21853108
     3109
    21863110<procedure>(sdl-rw-from-const-mem pointer) → sdl-rwops</procedure>
    21873111
    21883112See [[https://wiki.libsdl.org/SDL_RWFromConstMem|SDL_RWFromConstMem]].
    21893113
     3114
    21903115<procedure>(sdl-rw-from-mem pointer) → sdl-rwops</procedure>
    21913116
    21923117See [[https://wiki.libsdl.org/SDL_RWFromMem|SDL_RWFromMem]].
     3118
    21933119
    21943120<procedure>(sdl-rw-from-blob blob) → sdl-rwops</procedure>
     
    22023128try to read or write from the sdl-rwops.
    22033129
     3130
    22043131<procedure>(sdl-rw-from-string str) → sdl-rwops</procedure>
    22053132
     
    22123139try to read or write from the sdl-rwops.
    22133140
     3141
    22143142<procedure>(sdl-rw-from-u8vector u8v) → sdl-rwops</procedure>
    22153143
     
    22223150crash if you try to read or write from the sdl-rwops.
    22233151
     3152
    22243153<procedure>(sdl-rw-close! rwops) → fixnum</procedure>
    22253154
     
    22293158
    22303159Returns zero if successful.
     3160
    22313161
    22323162
     
    22373167Create a new surface with the given width, height, and color depth (in
    22383168bits per pixel). This is a more convenient interface for
    2239 sdl-create-rgb-surface. The surface's pixel format masks will be
     3169{{sdl-create-rgb-surface}}. The surface's pixel format masks will be
    22403170chosen automatically based on the requested depth and the current
    22413171platform's byte order (little endian or big endian). Returns #f if the
     
    22463176memory will automatically be freed when the record instance is garbage
    22473177collected. It is not necessary to call {{sdl-free-surface!}}, although
    2248 it is safe to do so.
     3178it is safe (and sometimes useful) to do so.
    22493179
    22503180See also {{sdl-make-surface*}}, which does not set a finalizer.
     3181
    22513182
    22523183<procedure>(sdl-make-surface* width height depth) → sdl-surface or #f</procedure>
     
    22563187with the surface.
    22573188
     3189
    22583190<procedure>(sdl-create-rgb-surface flags width height depth rmask gmask bmask amask) → sdl-surface</procedure>
    22593191
    22603192See [[https://wiki.libsdl.org/SDL_CreateRGBSurface|SDL_CreateRGBSurface]].
    22613193
    2262 See also sdl-make-surface for a more convenient interface.
     3194See also {{sdl-make-surface}} for a more convenient interface.
     3195
    22633196
    22643197<procedure>(sdl-create-rgb-surface-from pixels width height depth pitch rmask gmask bmask amask) → sdl-surface</procedure>
     
    22663199See [[https://wiki.libsdl.org/SDL_CreateRGBSurfaceFrom|SDL_CreateRGBSurfaceFrom]].
    22673200
     3201
    22683202<procedure>(sdl-convert-surface surface pixel-format flags) → sdl-surface</procedure>
    22693203
    22703204See [[https://wiki.libsdl.org/SDL_ConvertSurface|SDL_ConvertSurface]].
     3205
    22713206
    22723207<procedure>(sdl-load-bmp path-string) → sdl-surface</procedure>
     
    22773212memory will automatically be freed when the record instance is garbage
    22783213collected. It is not necessary to call {{sdl-free-surface!}}, although
    2279 it is safe to do so.
     3214it is safe (and sometimes useful) to do so.
     3215
    22803216
    22813217<procedure>(sdl-load-bmp* filepath) → sdl-surface</procedure>
     
    22853221the surface.
    22863222
     3223
    22873224<procedure>(sdl-load-bmp-rw rwops) → sdl-surface</procedure>
    22883225
     
    22923229memory will automatically be freed when the record instance is garbage
    22933230collected. It is not necessary to call {{sdl-free-surface!}}, although
    2294 it is safe to do so.
     3231it is safe (and sometimes useful) to do so.
     3232
    22953233
    22963234<procedure>(sdl-load-bmp-rw* rwops) → sdl-surface</procedure>
     
    23003238with the surface.
    23013239
     3240
    23023241<procedure>(sdl-save-bmp! surface filepath) → fixnum</procedure>
    23033242
     
    23063245Returns zero if successful.
    23073246
     3247
    23083248<procedure>(sdl-save-bmp-rw! surface rwops) → fixnum</procedure>
    23093249
     
    23123252Returns zero if successful.
    23133253
     3254
    23143255<procedure>(sdl-lock-surface! surface) → fixnum</procedure>
    23153256
     
    23183259Returns zero if successful.
    23193260
     3261
    23203262<procedure>(sdl-unlock-surface! surface)</procedure>
    23213263
    23223264See [[https://wiki.libsdl.org/SDL_UnlockSurface|SDL_UnlockSurface]].
    23233265
     3266
    23243267<procedure>(sdl-must-lock? surface) → boolean</procedure>
    23253268
    23263269See [[https://wiki.libsdl.org/SDL_MUSTLOCK|SDL_MUSTLOCK]].
    23273270
     3271
    23283272<procedure>(sdl-blit-surface! src src-rect dest dest-rect) → fixnum</procedure>
    23293273
     
    23323276Returns zero if successful. May modify dest-rect.
    23333277
     3278
    23343279<procedure>(sdl-blit-scaled! src src-rect dest dest-rect) → fixnum</procedure>
    23353280
     
    23383283Returns zero if successful. May modify dest-rect.
    23393284
     3285
    23403286<procedure>(sdl-lower-blit! src src-rect dest dest-rect) → fixnum</procedure>
    23413287
     
    23443290Returns zero if successful. May modify dest-rect.
    23453291
     3292
    23463293<procedure>(sdl-lower-blit-scaled! src src-rect dest dest-rect) → fixnum</procedure>
    23473294
     
    23493296
    23503297Returns zero if successful. May modify dest-rect.
     3298
    23513299
    23523300<procedure>(sdl-fill-rect! surface rect color) → fixnum</procedure>
     
    23623310Returns zero if successful.
    23633311
     3312
    23643313<procedure>(sdl-fill-rects! surface rects color) → fixnum</procedure>
    23653314
     
    23733322Returns zero if successful.
    23743323
     3324
    23753325<procedure>(sdl-surface-ref surface x y) → sdl-color</procedure>
    23763326
    23773327Returns the color of the specified pixel on the surface, as an
    2378 sdl-color. Signals an error if x or y is out of bounds.
     3328sdl-color. Signals an error if {{x}} or {{y}} is out of bounds.
     3329
    23793330
    23803331<procedure>(sdl-surface-ref-raw surface x y) → fixnum</procedure>
     
    23843335mapped color to color fields.
    23853336
     3337
    23863338<setter>(set! (sdl-surface-ref surface x y) color)</setter>
    23873339<setter>(sdl-surface-set! surface x y color)</setter>
    23883340
    23893341Set the color of the specified pixel on the surface. Automatically
    2390 locks and unlocks the surface if needed. {{color}} can be either a
    2391 sdl-color or a mapped color (an integer). Note: This procedure ignores
    2392 the surface's clip rect (if any).
     3342locks and unlocks the surface if needed. Signals an error if {{x}} or
     3343{{y}} is out of bounds. {{color}} can be either a sdl-color or a
     3344mapped color (an integer). Note: This procedure ignores the surface's
     3345clip rect (if any).
     3346
    23933347
    23943348<procedure>(sdl-surface-clip-rect surface) → sdl-rect</procedure>
     
    23973351
    23983352Returns a copy of the surface's clip rect.
     3353
    23993354
    24003355<setter>(set! (sdl-surface-clip-rect surface) rect) → boolean</setter>
     
    24033358See [[https://wiki.libsdl.org/SDL_SetClipRect|SDL_SetClipRect]].
    24043359
    2405 Sets the surface's clip rect to a copy of the given rect. Or rect can
    2406 be #f to disable clipping.
     3360Sets the surface's clip rect to a copy of the given rect. Or {{rect}}
     3361can be #f to disable clipping.
    24073362
    24083363Returns #t if the given rect intersects the surface at all, or #f if
    2409 the rect is out of bounds / completely clips out the surface.
     3364the rect is out of bounds (completely clips out the surface).
     3365
    24103366
    24113367<procedure>(sdl-surface-color-key surface) → sdl-color or #f</procedure>
    24123368
    24133369See [[https://wiki.libsdl.org/SDL_GetColorKey|SDL_GetColorKey]].
     3370
    24143371
    24153372<procedure>(sdl-surface-color-key-raw surface) → fixnum or #f</procedure>
     
    24183375integer) instead of a sdl-color.
    24193376
     3377
    24203378<setter>(set! (sdl-surface-color-key surface) color) → boolean</setter>
    24213379<setter>(sdl-surface-color-key-set! surface color) → boolean</setter>
     
    24283386Returns zero if successful.
    24293387
     3388
    24303389<procedure>(sdl-surface-alpha-mod surface) → fixnum</procedure>
    24313390
    24323391See [[https://wiki.libsdl.org/SDL_GetSurfaceAlphaMod|SDL_GetSurfaceAlphaMod]].
     3392
    24333393
    24343394<setter>(set! (sdl-surface-alpha-mod surface) mod) → fixnum</setter>
     
    24393399Returns zero on success.
    24403400
     3401
    24413402<procedure>(sdl-surface-blend-mode surface) → symbol</procedure>
    24423403
    24433404See [[https://wiki.libsdl.org/SDL_GetSurfaceBlendMode|SDL_GetSurfaceBlendMode]].
    24443405
    2445 Returns one of these symbols: {{'none}}, {{'blend}}, {{'add}}, or
    2446 {{'mod}}.
     3406Returns a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#blend-mode|blend mode symbol]]:
     3407
     3408* {{'none}}
     3409* {{'blend}}
     3410* {{'add}}
     3411* {{'mod}}
     3412
    24473413
    24483414<setter>(set! (sdl-surface-blend-mode surface) mode)</setter>
     
    24513417See [[https://wiki.libsdl.org/SDL_SetSurfaceBlendMode|SDL_SetSurfaceBlendMode]].
    24523418
    2453 {{mode}} can be one of these symbols: {{'none}}, {{'blend}}, {{'add}},
    2454 or {{'mod}}.
     3419{{mode}} must be a [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#blend-mode|blend mode symbol]] or equivalent integer:
     3420
     3421* {{'none}}
     3422* {{'blend}}
     3423* {{'add}}
     3424* {{'mod}}
     3425
    24553426
    24563427<procedure>(sdl-surface-color-mod surface) → [r g b]</procedure>
     
    24593430
    24603431Returns multiple values.
     3432
    24613433
    24623434<setter>(set! (sdl-surface-color-mod surface) rgb)</setter>
     
    24653437See [[https://wiki.libsdl.org/SDL_SetSurfaceColorMod|SDL_SetSurfaceColorMod]].
    24663438
    2467 {{rgb}} can be a list {{(r g b)}} of color values, or a sdl-color (in
    2468 which case the alpha field will be ignored).
     3439{{rgb}} can be a list {{(r g b)}} of color values, or a sdl-color (the
     3440sdl-color's "a" field will be ignored).
     3441
    24693442
    24703443<procedure>(sdl-surface-palette surface) → sdl-palette or #f</procedure>
    24713444
    2472 Returns the surface's palette, or #f if it has no palette. This is the
    2473 same as doing:
     3445Returns the surface's palette, or #f if it has no palette. This is
     3446equivalent to:
    24743447
    24753448 (sdl-pixel-format-palette
    24763449  (sdl-surface-format surface))
    24773450
     3451
    24783452<setter>(set! (sdl-surface-palette surface) palette)</setter>
    24793453<setter>(sdl-surface-palette-set! surface palette)</setter>
     
    24813455See [[https://wiki.libsdl.org/SDL_SetSurfacePalette|SDL_SetSurfacePalette]].
    24823456
     3457
    24833458<setter>(sdl-surface-rle-set! surface enable)</setter>
    24843459
     
    24883463
    24893464
     3465
    24903466==== Timer
    24913467
     
    24943470See [[https://wiki.libsdl.org/SDL_Delay|SDL_Delay]].
    24953471
     3472
    24963473<procedure>(sdl-get-ticks) → fixnum</procedure>
    24973474
    24983475See [[https://wiki.libsdl.org/SDL_GetTicks|SDL_GetTicks]].
    24993476
     3477
    25003478<procedure>(sdl-get-performance-counter) → fixnum</procedure>
    25013479
    25023480See [[https://wiki.libsdl.org/SDL_GetPerformanceCounter|SDL_GetPerformanceCounter]].
    25033481
     3482
    25043483<procedure>(sdl-get-performance-frequency) → fixnum</procedure>
    25053484
    25063485See [[https://wiki.libsdl.org/SDL_GetPerformanceFrequency|SDL_GetPerformanceFrequency]].
     3486
    25073487
    25083488<procedure>(sdl-ticks-passed? ticks-a ticks-b) → boolean</procedure>
     
    25153495
    25163496
     3497
    25173498==== Window
    25183499
     
    25233504{{x}} and {{y}} can be integers, the symbol {{'centered}}, or the symbol {{'undefined}}.
    25243505
    2525 {{flags}} is a list of zero or more of the following symbols:
    2526 
    2527 * fullscreen
    2528 * fullscreen-desktop
    2529 * opengl
    2530 * shown
    2531 * hidden
    2532 * borderless
    2533 * resizable
    2534 * minimized
    2535 * maximized
    2536 * input-grabbed
    2537 * input-focus
    2538 * mouse-focus
    2539 * foreign
     3506{{flags}} must be a list of zero or more [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#window-flags|window flag symbols]] (or an equivalent integer bitfield):
     3507
     3508* {{'fullscreen}}
     3509* {{'fullscreen-desktop}}
     3510* {{'opengl}}
     3511* {{'shown}}
     3512* {{'hidden}}
     3513* {{'borderless}}
     3514* {{'resizable}}
     3515* {{'minimized}}
     3516* {{'maximized}}
     3517* {{'input-grabbed}}
     3518* {{'input-focus}}
     3519* {{'mouse-focus}}
     3520* {{'foreign}}
     3521
    25403522
    25413523<procedure>(sdl-get-window-from-id id) → sdl-window</procedure>
     
    25433525See [[https://wiki.libsdl.org/SDL_GetWindowFromID|SDL_GetWindowFromID]].
    25443526
     3527
    25453528<procedure>(sdl-destroy-window! window)</procedure>
    25463529
    25473530See [[https://wiki.libsdl.org/SDL_DestroyWindow|SDL_DestroyWindow]].
    25483531
     3532
    25493533<procedure>(sdl-update-window-surface! window) → fixnum</procedure>
    25503534
     
    25533537Returns zero if successful.
    25543538
     3539
    25553540<procedure>(sdl-update-window-surface-rects! window rects) → fixnum</procedure>
    25563541
     
    25613546Returns zero if successful.
    25623547
     3548
    25633549<procedure>(sdl-show-window! window)</procedure>
    25643550
    25653551See [[https://wiki.libsdl.org/SDL_ShowWindow|SDL_ShowWindow]].
    25663552
     3553
    25673554<procedure>(sdl-hide-window! window)</procedure>
    25683555
    25693556See [[https://wiki.libsdl.org/SDL_HideWindow|SDL_HideWindow]].
    25703557
     3558
    25713559<procedure>(sdl-maximize-window! window)</procedure>
    25723560
    25733561See [[https://wiki.libsdl.org/SDL_MaximizeWindow|SDL_MaximizeWindow]].
    25743562
     3563
    25753564<procedure>(sdl-minimize-window! window)</procedure>
    25763565
    25773566See [[https://wiki.libsdl.org/SDL_MinimizeWindow|SDL_MinimizeWindow]].
    25783567
     3568
    25793569<procedure>(sdl-raise-window! window)</procedure>
    25803570
    25813571See [[https://wiki.libsdl.org/SDL_RaiseWindow|SDL_RaiseWindow]].
    25823572
     3573
    25833574<procedure>(sdl-restore-window! window)</procedure>
    25843575
    25853576See [[https://wiki.libsdl.org/SDL_RestoreWindow|SDL_RestoreWindow]].
     3577
    25863578
    25873579<setter>(sdl-window-bordered-set! window bordered)</setter>
     
    25943586(There is currently no getter.)
    25953587
     3588
    25963589<procedure>(sdl-window-brightness window) → float</procedure>
    25973590
    25983591See [[https://wiki.libsdl.org/SDL_GetWindowBrightness|SDL_GetWindowBrightness]].
     3592
    25993593
    26003594<setter>(set! (sdl-window-brightness window) brightness) → fixnum</setter>
     
    26053599Returns zero if successful.
    26063600
     3601
    26073602<procedure>(sdl-window-display-index window) → fixnum</procedure>
    26083603
    26093604See [[https://wiki.libsdl.org/SDL_GetWindowDisplayIndex|SDL_GetWindowDisplayIndex]].
    26103605
     3606
    26113607<procedure>(sdl-window-display-mode window) → sdl-display-mode</procedure>
    26123608
    26133609See [[https://wiki.libsdl.org/SDL_GetWindowDisplayMode|SDL_GetWindowDisplayMode]].
     3610
    26143611
    26153612<setter>(set! (sdl-window-display-mode surface) mode) → boolean</setter>
    26163613<setter>(sdl-window-display-mode-set! surface mode) → boolean</setter>
    26173614
     3615TODO: Docs.
     3616
     3617
    26183618<procedure>(sdl-window-flags window) → list of symbols</procedure>
    26193619
    26203620See [[https://wiki.libsdl.org/SDL_GetWindowFlags|SDL_GetWindowFlags]].
    26213621
    2622 See {{sdl-create-window!}} for a list of the possible flag symbols.
     3622Returns a list of [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#window-flags|window flag symbols]].
     3623
    26233624
    26243625<setter>(sdl-window-fullscreen-set! window mode)</setter>
     
    26283629{{mode}} can be:
    26293630
    2630 ; #t or 'fullscreen : fullscreen
     3631; 'fullscreen or #t : fullscreen
    26313632; 'fullscreen-desktop : fullscreen desktop
    26323633; #f : not fullscreen
     
    26343635Returns zero if successful.
    26353636
     3637
    26363638<procedure>(sdl-window-grab window) → boolean</procedure>
    26373639
    26383640See [[https://wiki.libsdl.org/SDL_GetWindowGrab|SDL_GetWindowGrab]].
     3641
    26393642
    26403643<setter>(set! (sdl-window-grab window) grab?</setter>
     
    26433646See [[https://wiki.libsdl.org/SDL_SetWindowGrab|SDL_SetWindowGrab]].
    26443647
     3648
    26453649<setter>(sdl-window-icon-set! window icon-surface)</setter>
    26463650
    26473651See [[https://wiki.libsdl.org/SDL_SetWindowIcon|SDL_SetWindowIcon]].
    26483652
     3653
    26493654<procedure>(sdl-window-id window) → fixnum</procedure>
    26503655
    26513656See [[https://wiki.libsdl.org/SDL_GetWindowID|SDL_GetWindowID]].
    26523657
     3658
    26533659<procedure>(sdl-window-maximum-size window) → [width height]</procedure>
    26543660
    26553661See [[https://wiki.libsdl.org/SDL_GetWindowMaximumSize|SDL_GetWindowMaximumSize]].
     3662
    26563663
    26573664<setter>(set! (sdl-window-maximum-size window) size)</setter>
     
    26603667{{size}} must be a list of integers {{(width height)}}.
    26613668
     3669
    26623670<procedure>(sdl-window-minimum-size window) → [width height]</procedure>
    26633671
    26643672See [[https://wiki.libsdl.org/SDL_GetWindowMinimumSize|SDL_GetWindowMinimumSize]].
     3673
    26653674
    26663675<setter>(set! (sdl-window-minimum-size window) size)</setter>
     
    26693678{{size}} must be a list of integers {{(width height)}}.
    26703679
     3680
    26713681<procedure>(sdl-window-pixel-format window) → sdl-pixel-format</procedure>
    26723682
    26733683See [[https://wiki.libsdl.org/SDL_GetWindowPixelFormat|SDL_GetWindowPixelFormat]].
    26743684
     3685
    26753686<procedure>(sdl-window-position window) → [x y]</procedure>
    26763687
    26773688See [[https://wiki.libsdl.org/SDL_GetWindowPosition|SDL_GetWindowPosition]].
     3689
    26783690
    26793691<setter>(set! (sdl-window-position window) pos)</setter>
     
    26823694{{pos}} must be a list of integers {{(x y)}}.
    26833695
     3696
    26843697<procedure>(sdl-window-size window) → [width height]</procedure>
    26853698
    26863699See [[https://wiki.libsdl.org/SDL_GetWindowSize|SDL_GetWindowSize]].
     3700
    26873701
    26883702<setter>(set! (sdl-window-size window) size)</setter>
     
    26933707{{size}} must be a list of integers {{(width height)}}.
    26943708
     3709
    26953710<procedure>(sdl-window-surface window) → sdl-surface</procedure>
    26963711
    26973712See [[https://wiki.libsdl.org/SDL_GetWindowSurface|SDL_GetWindowSurface]].
    26983713
     3714
    26993715<procedure>(sdl-window-title window) → string</procedure>
    27003716
    27013717See [[https://wiki.libsdl.org/SDL_GetWindowTitle|SDL_GetWindowTitle]].
     3718
    27023719
    27033720<setter>(set! (sdl-window-title window) title)</setter>
Note: See TracChangeset for help on using the changeset viewer.