Changeset 32982 in project


Ignore:
Timestamp:
12/15/15 08:31:17 (6 years ago)
Author:
John Croisant
Message:

sdl2-image: Procedures now signal an exception.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/sdl2-image

    r32900 r32982  
    122122  See [[/egg/sdl2#struct-memory-management|Struct Memory Management]] in the sdl2 egg docs.
    123123
     124* Procedures signal an exception of kind {{(exn sdl2)}} if they fail.
     125
    124126
    125127=== General
     
    153155
    154156<procedure>(compiled-version) → list of fixnums</procedure>
    155 <procedure>(current-version) → list of fixnums</procedure>
     157<procedure>(current-version)  â†’ list of fixnums</procedure>
    156158
    157159Returns a list of three nonnegative integers, indicating a version number of SDL_image.
     
    171173=== Loading
    172174
    173 <procedure>(load filepath) → sdl2:surface or #f</procedure>
    174 <procedure>(load* filepath) → sdl2:surface or #f</procedure>
     175<procedure>(load  filepath) → sdl2:surface</procedure>
     176<procedure>(load* filepath) → sdl2:surface</procedure>
    175177
    176178Attempts to load the image file at the given filepath (a string).
     
    178180See [[http://www.libsdl.org/projects/SDL_image/docs/SDL_image.html#SEC11|IMG_Load]].
    179181
    180 Returns a [[/egg/sdl2#sdl2surface|sdl2:surface]] with the image contents, or #f if the image could not be loaded.
    181 Call {{get-error}} (from the sdl2 egg) to find out what the problem is.
     182Returns a [[/egg/sdl2#sdl2surface|sdl2:surface]] with the image contents.
     183Signals an exception of kind {{(exn sdl2)}} if the image could not be loaded.
    182184
    183185* {{load}} returns a managed sdl2:surface.
     
    185187
    186188
    187 <procedure>(load-rw rwops #!optional close?) → sdl2:surface or #f</procedure>
    188 <procedure>(load-rw* rwops #!optional close?) → sdl2:surface or #f</procedure>
     189<procedure>(load-rw  rwops #!optional close?) → sdl2:surface</procedure>
     190<procedure>(load-rw* rwops #!optional close?) → sdl2:surface</procedure>
    189191
    190192Attempts to load an image from an [[/egg/sdl2#rwops|sdl2:rwops]].
     
    193195
    194196The image may be any format supported by SDL_image.
    195 But, if you want to load a TGA image from an sdl2:rwops, you will probably need to use {{load-typed-rw}} instead of {{load-rw}}.
     197But, if you want to load a TGA image from an sdl2:rwops, you may need to use {{load-typed-rw}} instead of {{load-rw}}.
    196198
    197199If {{close?}} is #t, the sdl2:rwops will be automatically closed after the image is loaded.
     
    199201If {{close?}} is #f (the default), the sdl2:rwops will not be closed.
    200202
    201 Returns a [[/egg/sdl2#sdl2surface|sdl2:surface]] with the image contents, or #f if the image could not be loaded.
    202 Call {{get-error}} (from the sdl2 egg) to find out what the problem is.
     203Returns a [[/egg/sdl2#sdl2surface|sdl2:surface]] with the image contents.
     204Signals an exception of kind {{(exn sdl2)}} if the image could not be loaded.
    203205
    204206* {{load-rw}} returns a managed sdl2:surface.
     
    206208
    207209
    208 <procedure>(load-typed-rw rwops close? type-hint) → sdl2:surface or #f</procedure>
    209 <procedure>(load-typed-rw* rwops close? type) → sdl2:surface or #f</procedure>
     210<procedure>(load-typed-rw  rwops close? type-hint) → sdl2:surface</procedure>
     211<procedure>(load-typed-rw* rwops close? type-hint) → sdl2:surface</procedure>
    210212
    211213See [[http://www.libsdl.org/projects/SDL_image/docs/SDL_image.html#SEC13|IMG_LoadTyped_RW]].
    212214
    213 Similar to {{load-rw}}, except you also give a hint to help SDL_image figure out what the image format.
     215Similar to {{load-rw}}, except you also give a hint to help SDL_image figure out what the image format is.
    214216In practice, this is only necessary when loading TGA images.
    215 For all other image formats you can use {{load-rw}} instead.
     217For other image formats you can use {{load-rw}} instead.
    216218
    217219{{type-hint}} must be one of the following strings (case is not important):
     
    232234* {{"XV"}}
    233235
    234 Returns a [[/egg/sdl2#sdl2surface|sdl2:surface]] containing the image, or #f if the image could not be loaded.
    235 Call {{get-error}} (from the sdl2 egg) to find out what the problem is.
     236Returns a [[/egg/sdl2#sdl2surface|sdl2:surface]] containing the image.
     237Signals an exception of kind {{(exn sdl2)}} if the image could not be loaded.
    236238
    237239* {{load-rw-typed}} returns a managed sdl2:surface.
Note: See TracChangeset for help on using the changeset viewer.