Changeset 32909 in project


Ignore:
Timestamp:
11/14/15 05:44:56 (5 years ago)
Author:
John Croisant
Message:

sdl2: More work on docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/sdl2

    r32893 r32909  
    4646
    4747
     48== Related Libraries
     49
     50The [[/egg/sdl2-image|sdl2-image egg]] provides bindings to version 2 of the SDL_image library, which provides the ability to load many image formats. It is built to be compatible with sdl2.
     51
     52The [[/egg/sdl-base|sdl-base egg]] provides bindings to older versions of SDL. Its API is not compatible with sdl2.
     53
     54
    4855== Installation
    4956
     
    7986<enscript highlight="scheme">
    8087(use (prefix sdl2 sdl2:))
     88(sdl2:set-main-ready!)
    8189(sdl2:init! '(video))
    8290(define window (sdl2:create-window! "Hello, World!" 0 0 600 400))
     
    101109=== Ensuring Proper Clean Up
    102110
    103 You must make sure to call the {{quit!}} procedure (from this egg) before your program ends.
    104 This is especially important if your program enters fullscreen mode or changes the display gamma ramp.
    105 If your program doesn't call {{quit!}}, those changes may persist even after your program has ended, which can be very frustrating for your program's users.
     111You must make sure to call {{set-main-ready!}} and {{init!}} (in that order) soon after your program starts, and to call {{quit!}} before your program ends.
     112This is especially important if your program enters fullscreen mode, or changes the display brightness or gamma ramp.
     113If your program does not perform proper initialization and clean up, those changes can sometimes linger even after your program has ended, which can be very frustrating for your program's users.
     114It is even possible for the user's computer to become stuck in fullscreen mode, requiring the user to power off their computer, possibly losing important work that they were doing in other programs!
    106115
    107116Here is a simple way to ensure that {{quit!}} is called before your program ends, whether exitting normally or because an exception occurred:
     
    110119(use (prefix sdl2 sdl2:))
    111120
    112 ;; Call quit! before your program exits normally.
     121;; Initialize SDL
     122(sdl2:set-main-ready!)
     123(sdl2:init! '(video)) ;; or whatever init flags your program needs
     124
     125;; Schedule quit! to be automatically called when your program exits normally.
    113126(on-exit sdl2:quit!)
    114127
     
    128141
    129142
    130 == Related Libraries
    131 
    132 The [[/egg/sdl2-image|sdl2-image egg]] provides bindings to version 2 of the SDL_image library, which provides the ability to load many image formats. It is built to be compatible with sdl2.
    133 
    134 The [[/egg/sdl-base|sdl-base egg]] provides bindings to older versions of SDL. Its API is not compatible with sdl2.
    135 
    136 
    137143== Version History
    138144
     
    197203=== Function Bindings
    198204
    199 ==== General / Miscellaneous
     205==== Initialization and Clean Up
     206
     207<procedure>(set-main-ready!)</procedure>
     208
     209See [[https://wiki.libsdl.org/SDL_SetMainReady|SDL_SetMainReady]].
     210
     211You should call this soon after your program starts, '''before''' calling {{init!}}.
     212See [[/egg/sdl2#ensuring-proper-clean-up|Ensuring Proper Clean Up]].
     213
    200214
    201215<procedure>(init! #!optional flags-list) → fixnum</procedure>
    202216
    203 See [[https://wiki.libsdl.org/SDL_Init|SDL_Init]].
    204 Returns zero if successful.
     217Initialize SDL.
     218You should call this soon after your program starts, '''after''' calling {{set-main-ready!}}.
     219See [[/egg/sdl2#ensuring-proper-clean-up|Ensuring Proper Clean Up]].
    205220
    206221{{flags-list}} defaults to {{'(everything)}}. It 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]]:
     
    215230* {{'everything}}
    216231
     232See [[https://wiki.libsdl.org/SDL_Init|SDL_Init]].
     233Returns zero if successful.
     234
    217235
    218236<procedure>(init-subsystem! flags-list) → fixnum</procedure>
     
    226244<procedure>(quit!)</procedure>
    227245
    228 See [[https://wiki.libsdl.org/SDL_Quit|SDL_Quit]].
    229 
     246Clean up SDL.
    230247You must make sure to call this before your program ends.
    231248See [[/egg/sdl2#ensuring-proper-clean-up|Ensuring Proper Clean Up]].
    232249
     250See [[https://wiki.libsdl.org/SDL_Quit|SDL_Quit]].
     251
    233252
    234253<procedure>(quit-subsystem! flags-list)</procedure>
     
    245264{{flags-list}} defaults to {{'(everything)}}. It 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.
    246265
    247 
    248 <procedure>(set-main-ready!)</procedure>
    249 
    250 See [[https://wiki.libsdl.org/SDL_SetMainReady|SDL_SetMainReady]].
    251 
    252 
    253 <procedure>(clear-error!)</procedure>
    254 
    255 See [[https://wiki.libsdl.org/SDL_ClearError|SDL_ClearError]].
    256 
    257 
    258 <procedure>(get-error) → string</procedure>
    259 
    260 See [[https://wiki.libsdl.org/SDL_GetError|SDL_GetError]].
    261 
    262 
    263 <procedure>(set-error! message)</procedure>
    264 
    265 See [[https://wiki.libsdl.org/SDL_SetError|SDL_SetError]].
    266 
    267 Unlike SDL_SetError, this procedure only accepts one argument, a
    268 string. You can use {{sprintf}} to do string substitution if desired.
    269 
    270 
    271 <procedure>(get-platform) → string</procedure>
    272 
    273 See [[https://wiki.libsdl.org/SDL_GetPlatform|SDL_GetPlatform]].
    274 
    275 
    276 <procedure>(disable-screen-saver!)</procedure>
    277 
    278 See [[https://wiki.libsdl.org/SDL_DisableScreenSaver|SDL_DisableScreenSaver]].
    279 
    280 
    281 <procedure>(enable-screen-saver!)</procedure>
    282 
    283 See [[https://wiki.libsdl.org/SDL_EnableScreenSaver|SDL_EnableScreenSaver]].
    284 
    285 
    286 <procedure>(screen-saver-enabled?) → boolean</procedure>
    287 
    288 See [[https://wiki.libsdl.org/SDL_IsScreenSaverEnabled|SDL_IsScreenSaverEnabled]].
    289 
    290 
    291 <procedure>(has-clipboard-text?) → boolean</procedure>
    292 
    293 See [[https://wiki.libsdl.org/SDL_HasClipboardText|SDL_HasClipboardText]].
    294 
    295 
    296 <procedure>(get-clipboard-text) → string</procedure>
    297 
    298 See [[https://wiki.libsdl.org/SDL_GetClipboardText|SDL_GetClipboardText]].
    299 
    300 
    301 <procedure>(set-clipboard-text! text) → fixnum</procedure>
    302 
    303 See [[https://wiki.libsdl.org/SDL_SetClipboardText|SDL_SetClipboardText]].
    304 Returns zero if successful.
    305 
    306 
    307 <procedure>(version-at-least? major minor patch) → boolean</procedure>
    308 
    309 See [[https://wiki.libsdl.org/SDL_VERSION_ATLEAST|SDL_VERSION_ATLEAST]].
    310 
    311 Returns #t if the sdl2 egg was compiled with a version of SDL at least as high as specified.
    312 For example, {{(version-at-least? 2 0 1)}} returns #t if the sdl2 egg was compiled with SDL 2.0.1 or higher.
    313 
    314 Some SDL features are only available after a certain version, so you can use this procedure to check whether the feature is available.
    315 
    316 
    317 <procedure>(compiled-version) → list of fixnums</procedure>
    318 
    319 Returns a list of three nonnegative integers, indicating the version number of SDL that the sdl2 egg was compiled with.
    320 For example, if the sdl2 egg was compiled with SDL 2.0.1, this procedure would return the list {{(2 0 1)}}.
    321 See [[https://wiki.libsdl.org/SDL_VERSION|SDL_VERSION]].
    322 
    323 The version returned by this procedure may be different than the version the sdl2 egg is currently using.
    324 See {{current-version}}.
    325 
    326 For example, the user may have compiled the sdl2 egg using SDL 2.0.3, then later installed SDL 2.0.4, but not yet reinstalled the sdl2 egg.
    327 In such a case, {{compiled-version}} would return {{(2 0 3)}}, and {{current-version}} would return {{(2 0 4)}}.
    328 But, features from the new version would not be available until the user reinstalls the sdl2 egg.
    329 
    330 
    331 <procedure>(current-version) → list of fixnums</procedure>
    332 
    333 Returns a list of three nonnegative integers, indicating the version number of SDL that the sdl2 egg is currently using.
    334 For example, if the sdl2 egg is currently using SDL 2.0.1, this procedure would return the list {{(2 0 1)}}.
    335 See [[https://wiki.libsdl.org/SDL_GetVersion|SDL_GetVersion]].
    336 
    337 The version returned by this procedure may be different than the version the sdl2 egg was compiled with.
    338 See {{compiled-version}}.
    339266
    340267
     
    345272<setter>(event-state-set! type state) → boolean</setter>
    346273
    347 {{event-state}} returns #t if the given event type is currently enabled, or #f if it is currently disabled (i.e. all future events of that type will be ignored).
    348 
    349 The setters enable (if {{state}} is #t) or disable (if {{state}} is #f) the given event type, then return the previous state of the given event type.
     274Get or set the state of the given event type.
     275#t means the event type is enabled, so events of that type may appear on the event queue.
     276#f means the event type is disabled, so events of that type will be automatically discarded.
     277It is beneficial to your program's performance to disable event types that your program does not need.
    350278
    351279{{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
    352280
     281If you set an event type's state to #f, any events of that type already on the event queue will be immediately discarded.
     282The setters return the previous state of the given event type.
     283
    353284See [[https://wiki.libsdl.org/SDL_EventState|SDL_EventState]].
    354285
    355286
    356287<procedure>(flush-event! type)</procedure>
    357 
    358 See [[https://wiki.libsdl.org/SDL_FlushEvent|SDL_FlushEvent]].
    359 
    360 Contrary to what its name suggests, this procedure will flush ALL events matching the given type, not just a single event.
    361 
    362 {{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
    363 
    364 
    365288<procedure>(flush-events! #!optional min-type max-type)</procedure>
    366289
    367 See [[https://wiki.libsdl.org/SDL_FlushEvents|SDL_FlushEvents]].
    368 
    369 {{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. If omitted, {{min-type}} defaults to {{'first}} and {{max-type}} defaults to {{'last}}.
     290Remove all events on the event queue that match the given type or range of types.
     291See [[https://wiki.libsdl.org/SDL_FlushEvent|SDL_FlushEvent]]
     292and [[https://wiki.libsdl.org/SDL_FlushEvents|SDL_FlushEvents]].
     293
     294For {{flush-event!}}, {{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
     295
     296For {{flush-events!}}, {{min-type}} and {{max-type}} specify the range of event types to remove.
     297Events with a type outside of this range will not be removed.
     298{{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.
     299{{min-type}} defaults to {{'first}} and {{max-type}} defaults to {{'last}}, which means all event types match by default.
    370300
    371301
    372302<procedure>(has-event? type) → boolean</procedure>
    373 
    374 See [[https://wiki.libsdl.org/SDL_HasEvent|SDL_HasEvent]].
    375 
    376 {{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
    377 
    378 
    379303<procedure>(has-events? #!optional min-type max-type) → boolean</procedure>
    380304
    381 See [[https://wiki.libsdl.org/SDL_HasEvents|SDL_HasEvents]].
    382 
    383 {{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. If omitted, {{min-type}} defaults to {{'first}} and {{max-type}} defaults to {{'last}}.
     305Returns #t if the event queue currently has at least one event matching the given type or range of types.
     306See [[https://wiki.libsdl.org/SDL_HasEvent|SDL_HasEvent]]
     307and [[https://wiki.libsdl.org/SDL_HasEvents|SDL_HasEvents]].
     308
     309For {{has-event?}}, {{type}} must be an [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#event-types|event type symbol]] or corresponding integer.
     310
     311For {{has-events?}}, {{min-type}} and {{max-type}} specify the range of event types to consider.
     312Events with a type outside of this range will not be considered.
     313{{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.
     314{{min-type}} defaults to {{'first}} and {{max-type}} defaults to {{'last}}, which means all event types match by default.
    384315
    385316
    386317<procedure>(quit-requested?) → boolean</procedure>
    387318
     319Returns #t if the event queue currently has at least one event of type {{'quit}}.
    388320See [[https://wiki.libsdl.org/SDL_QuitRequested|SDL_QuitRequested]].
    389321
    390322
     323<procedure>(get-events! num #!optional min-type max-type) → list of sdl2:events</procedure>
    391324<procedure>(peek-events num #!optional min-type max-type) → list of sdl2:events</procedure>
    392325
     326Get multiple matching events from the front of the event queue.
     327Returns a list of managed sdl2:events.
    393328See [[https://wiki.libsdl.org/SDL_PeepEvents|SDL_PeepEvents]].
    394329
    395 This procedure is similar to {{get-events!}}, except that this
    396 procedure does not remove the events from the SDL event queue.
    397 
    398 {{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. If omitted, {{min-type}} defaults to {{'first}} and {{max-type}} defaults to {{'last}}.
    399 
    400 Returns a list of managed sdl2:events.
    401 
    402 
    403 <procedure>(get-events! num #!optional min-type max-type) → list of sdl2:events</procedure>
    404 
    405 See [[https://wiki.libsdl.org/SDL_PeepEvents|SDL_PeepEvents]].
    406 
    407 This procedure is similar to {{peek-events}}, except that this
    408 procedure removes the events from the SDL event queue.
    409 
    410 {{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. If omitted, {{min-type}} defaults to {{'first}} and {{max-type}} defaults to {{'last}}.
    411 
    412 Returns a list of managed sdl2:events.
     330* {{get-events!}} removes the returned events from the event queue.
     331* {{peek-events}} does not remove the returned events from the event queue.
     332
     333{{num}} specifies the maximum number of events to return.
     334This procedure may return fewer events if there are not enough matching events on the event queue.
     335
     336{{min-type}} and {{max-type}} specify the range of event types to return.
     337Events with a type outside of this range will not be returned (they will remain on the queue).
     338{{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.
     339{{min-type}} defaults to {{'first}} and {{max-type}} defaults to {{'last}}, which means all event types match by default.
    413340
    414341
    415342<procedure>(poll-event! #!optional result-event) → sdl2:event</procedure>
    416343
     344Get the next event from the event queue.
     345The returned event is removed from the event queue.
    417346See [[https://wiki.libsdl.org/SDL_PollEvent|SDL_PollEvent]].
    418347
    419 If {{result-event}} is omitted or #f, a new managed sdl2:event will be
    420 allocated and returned. If {{result-event}} is an existing sdl2:event
    421 record, it will be modified and returned. This allows you to allocate
    422 a single event and reuse it many times in your event loop, so that
    423 your program does not create as much garbage for the garbage
    424 collector.
     348If {{result-event}} is omitted or #f, a new managed sdl2:event will be returned.
     349If {{result-event}} is an sdl2:event, it will be modified and returned.
     350This allows you to allocate a single event and reuse it many times in your event loop,
     351so that your program does not create as much garbage for the garbage collector.
    425352
    426353
     
    437364
    438365
    439 <procedure>(wait-event! #!optional result-event) → sdl2:event </procedure>
     366<procedure>(wait-event! #!optional result-event) → sdl2:event</procedure>
     367<procedure>(wait-event-timeout! timeout #!optional result-event) → sdl2:event or #f</procedure>
    440368
    441369Wait for the next event to appear on the event queue, then return it.
    442 If there is already an event on the event queue, it will be returned
    443 immediately. Otherwise, this procedure will block the current thread
    444 indefinitely until an event appears. See also {{wait-event-timeout!}}.
    445 
    446 If {{result-event}} is omitted or #f, a new managed sdl2:event will be
    447 returned. If {{result-event}} is a sdl2:event, it will be modified and
    448 returned. This allows you to allocate a single event and reuse it many
    449 times in your event loop, so that your program does not create as much
    450 garbage for the garbage collector.
    451 
    452 This procedure is compatible with [[/manual/Unit srfi-18|SRFI-18]]
    453 multithreading. Only the current thread will block while waiting.
     370The returned event will be removed from the event queue.
     371If there is already an event on the event queue, it will be returned immediately.
     372Otherwise, these procedures will block the current thread until the next event appears (or the timeout expires).
     373
     374* {{wait-event!}} will wait indefinitely for an event to appear.
     375* {{wait-event-timeout!}} will stop waiting and return #f if no event appears within {{timeout}} milliseconds.
     376  (It may actually wait a few milliseconds longer than specified.
     377  You should not rely on its timing being very precise.)
     378
     379If {{result-event}} is omitted or #f, a new managed sdl2:event will be returned.
     380If {{result-event}} is an sdl2:event, it will be modified and returned.
     381This allows you to allocate a single event and reuse it many times in your event loop,
     382so that your program does not create as much garbage for the garbage collector.
     383
     384These procedures are compatible with [[/manual/Unit srfi-18|SRFI-18]] multithreading.
     385Only the current thread will block while waiting.
    454386Other threads will continue as normal.
    455387
    456 This procedure is inspired by (but does not actually use)
    457 [[https://wiki.libsdl.org/SDL_WaitEvent|SDL_WaitEvent]].
    458 
    459 
    460 <procedure>(wait-event-timeout! timeout-ms #!optional result-event) → sdl2:event or #f</procedure>
    461 
    462 Similar to {{wait-event!}}, except that if no event appears on the
    463 event queue within {{timeout-ms}} milliseconds, this procedure will
    464 stop waiting and return #f. If an event does appear, this procedure
    465 immediately stops waiting and returns the event.
    466 
    467 This procedure may actually wait a few milliseconds longer than
    468 specified. You should not rely on its timing being very precise.
    469 
    470 This procedure is inspired by (but does not actually use)
     388These procedures are inspired by (but do not actually use)
     389[[https://wiki.libsdl.org/SDL_WaitEvent|SDL_WaitEvent]] and
    471390[[https://wiki.libsdl.org/SDL_WaitEventTimeout|SDL_WaitEventTimeout]].
    472 Please note that the argument order is reversed compared to
    473 SDL_WaitEventTimeout, to allow the {{result-event}} argument to be
    474 optional.
    475391
    476392
    477393<procedure>(register-events! event-symbols) → list of pairs</procedure>
    478394
    479 Register zero or more symbols as new user event types. After
    480 registration, the given symbols may be used as event types, e.g. with
    481 {{event-type-set!}}. The symbols will be associated with the
    482 sdl2:user-event variant of sdl2:event.
    483 
    484 {{event-symbols}} must be a list of symbols that are not already being
    485 used as event types. If any symbol is already being used, or if any
    486 member of the list is not a symbol, an error will be signalled and
    487 none of the new event types will be registered.
    488 
    489 There are 32767 user event type numbers available to register. Each
    490 symbol in {{event-symbols}} will be automatically assigned a distinct
    491 number. If there are not enough remaining numbers to register all the
    492 symbols in {{event-symbols}}, this procedure will signal an error, and
    493 none of the new event types will be registered.
    494 
    495 This procedure returns an association list (list of pairs) of each of
    496 the new event type symbols (as the pair car) with its assigned number
    497 (as the pair cdr).
     395Register zero or more symbols as new user event types.
     396After registration, the given symbols may be used as event types, e.g. with {{event-type-set!}}.
     397The symbols will be associated with the sdl2:user-event variant of sdl2:event.
     398
     399{{event-symbols}} must be a list of symbols that are not already being used as event types.
     400If any symbol is already being used, or if any member of the list is not a symbol,
     401an error will be signalled and none of the new event types will be registered.
     402
     403There are 32767 user event type numbers available to register.
     404Each symbol in {{event-symbols}} will be assigned a distinct, sequential number.
     405If there are not enough remaining numbers to register all the symbols in {{event-symbols}},
     406this procedure will signal an error, and none of the new event types will be registered.
     407
     408This procedure returns an association list (list of pairs) of each of the new event type symbols (as the pair car) with its assigned number (as the pair cdr).
    498409
    499410This procedure is based on [[https://wiki.libsdl.org/SDL_RegisterEvents|SDL_RegisterEvents]].
     
    13741285
    13751286See [[https://wiki.libsdl.org/SDL_GetPerformanceFrequency|SDL_GetPerformanceFrequency]].
     1287
     1288
     1289
     1290==== Version
     1291
     1292<procedure>(version-at-least? major minor patch) → boolean</procedure>
     1293
     1294See [[https://wiki.libsdl.org/SDL_VERSION_ATLEAST|SDL_VERSION_ATLEAST]].
     1295
     1296Returns #t if the sdl2 egg was compiled with a version of SDL at least as high as specified.
     1297For example, {{(version-at-least? 2 0 1)}} returns #t if the sdl2 egg was compiled with SDL 2.0.1 or higher.
     1298
     1299Some SDL features are only available after a certain version, so you can use this procedure to check whether the feature is available.
     1300
     1301
     1302<procedure>(compiled-version) → list of fixnums</procedure>
     1303<procedure>(current-version) → list of fixnums</procedure>
     1304
     1305Returns a list of three nonnegative integers, indicating a version number of SDL.
     1306For example, the list {{(2 0 3)}} indicates SDL 2.0.3.
     1307
     1308* {{compiled-version}} returns the version of SDL that the sdl2 egg was compiled with.
     1309* {{current-version}} returns the version of SDL that the sdl2 egg is currently using.
     1310
     1311For example, the user may have compiled the sdl2 egg with SDL 2.0.3, then later upgraded SDL to 2.1.0, but not yet recompiled the sdl2 egg with the new version.
     1312In such a case, {{compiled-version}} would return {{(2 0 3)}}, and {{current-version}} would return {{(2 1 0)}}.
     1313But, features from the new version would not be available until the user recompiles the sdl2 egg.
     1314
     1315See [[https://wiki.libsdl.org/SDL_VERSION|SDL_VERSION]]
     1316and [[https://wiki.libsdl.org/SDL_GetVersion|SDL_GetVersion]].
    13761317
    13771318
     
    14581399
    14591400
     1401<procedure>(window-bordered? window) → boolean</procedure>
     1402<setter>(set! (window-bordered? window) bordered)</setter>
    14601403<setter>(window-bordered-set! window bordered)</setter>
    14611404
     1405Get or set whether the window has a border (window decoration).
     1406#t means the window has a border, #f means the window is borderless.
     1407
     1408Setting this to #f has essentially the same effect as passing the {{'borderless}} flag to {{create-window!}} when creating the window.
     1409
    14621410See [[https://wiki.libsdl.org/SDL_SetWindowBordered|SDL_SetWindowBordered]].
    1463 
    1464 {{bordered}} is #t to enable window decoration or #f to disable window
    1465 decoration.
    1466 
    1467 (There is currently no getter.)
    14681411
    14691412
     
    14901433and [[https://wiki.libsdl.org/SDL_SetWindowDisplayMode|SDL_SetWindowDisplayMode]].
    14911434
    1492 The setters affect the display mode used when the window is fullscreen.
    14931435The setters return zero if successful.
    14941436
    14951437
    14961438<procedure>(window-flags window) → list of symbols</procedure>
     1439<procedure>(window-flags-raw window) → fixnum</procedure>
    14971440
    14981441See [[https://wiki.libsdl.org/SDL_GetWindowFlags|SDL_GetWindowFlags]].
    14991442
    1500 Returns a list of [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#window-flags|window flag symbols]].
    1501 
    1502 
     1443* {{window-flags}} returns a list of [[https://gitlab.com/chicken-sdl2/chicken-sdl2/blob/master/docs/enums.md#window-flags|window flag symbols]].
     1444* {{window-flags-raw}} returns an integer bitfield.
     1445
     1446
     1447<procedure>(window-fullscreen window) → symbol or #f</procedure>
     1448<setter>(set! (window-fullscreen window) mode)</setter>
    15031449<setter>(window-fullscreen-set! window mode)</setter>
    15041450
     1451Get or set the sdl2:window's fullscreen mode.
     1452
     1453{{window-fullscreen}} returns one of the following values:
     1454
     1455* {{'fullscreen}} means "real" fullscreen mode
     1456* {{'fullscreen-desktop}} means "fake" fullscreen mode that takes the size of the desktop
     1457* {{#f}} means windowed (non-fullscreen) mode
     1458
     1459The setters accept any of the above values, or #t (which means the same as {{'fullscreen}}), or an equivalent integer value.
     1460
    15051461See [[https://wiki.libsdl.org/SDL_SetWindowFullscreen|SDL_SetWindowFullscreen]].
    1506 
    1507 {{mode}} can be:
    1508 
    1509 ; 'fullscreen or #t : fullscreen
    1510 ; 'fullscreen-desktop : fullscreen desktop
    1511 ; #f : not fullscreen
    1512 
    1513 Returns zero if successful.
    15141462
    15151463
     
    15961544See [[https://wiki.libsdl.org/SDL_GetWindowTitle|SDL_GetWindowTitle]]
    15971545and [[https://wiki.libsdl.org/SDL_SetWindowTitle|SDL_SetWindowTitle]].
     1546
     1547
     1548
     1549==== Miscellaneous
     1550
     1551<procedure>(clear-error!)</procedure>
     1552
     1553See [[https://wiki.libsdl.org/SDL_ClearError|SDL_ClearError]].
     1554
     1555
     1556<procedure>(get-error) → string</procedure>
     1557
     1558See [[https://wiki.libsdl.org/SDL_GetError|SDL_GetError]].
     1559
     1560
     1561<procedure>(set-error! message)</procedure>
     1562
     1563See [[https://wiki.libsdl.org/SDL_SetError|SDL_SetError]].
     1564
     1565Unlike SDL_SetError, this procedure only accepts one argument, a
     1566string. You can use {{sprintf}} to do string substitution if desired.
     1567
     1568
     1569<procedure>(get-platform) → string</procedure>
     1570
     1571See [[https://wiki.libsdl.org/SDL_GetPlatform|SDL_GetPlatform]].
     1572
     1573
     1574<procedure>(disable-screen-saver!)</procedure>
     1575
     1576See [[https://wiki.libsdl.org/SDL_DisableScreenSaver|SDL_DisableScreenSaver]].
     1577
     1578
     1579<procedure>(enable-screen-saver!)</procedure>
     1580
     1581See [[https://wiki.libsdl.org/SDL_EnableScreenSaver|SDL_EnableScreenSaver]].
     1582
     1583
     1584<procedure>(screen-saver-enabled?) → boolean</procedure>
     1585
     1586See [[https://wiki.libsdl.org/SDL_IsScreenSaverEnabled|SDL_IsScreenSaverEnabled]].
     1587
     1588
     1589<procedure>(has-clipboard-text?) → boolean</procedure>
     1590
     1591See [[https://wiki.libsdl.org/SDL_HasClipboardText|SDL_HasClipboardText]].
     1592
     1593
     1594<procedure>(get-clipboard-text) → string</procedure>
     1595
     1596See [[https://wiki.libsdl.org/SDL_GetClipboardText|SDL_GetClipboardText]].
     1597
     1598
     1599<procedure>(set-clipboard-text! text) → fixnum</procedure>
     1600
     1601See [[https://wiki.libsdl.org/SDL_SetClipboardText|SDL_SetClipboardText]].
     1602Returns zero if successful.
    15981603
    15991604
Note: See TracChangeset for help on using the changeset viewer.