diff options
-rw-r--r-- | doc/api.texi | 4 | ||||
-rw-r--r-- | sdl2/bindings.scm | 3 | ||||
-rw-r--r-- | sdl2/video.scm | 7 |
3 files changed, 14 insertions, 0 deletions
diff --git a/doc/api.texi b/doc/api.texi index 8a352a4..204db9e 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -162,6 +162,10 @@ remove the border. Set the title of @var{window} to the string @var{title}. @end deffn +@deffn {Procedure} set-window-icon! window icon +Set the icon of @var{window} to the surface @var{icon}. +@end deffn + @deffn {Procedure} set-window-position! window x y Set the position of @var{window} to (@var{x}, @var{y}). @end deffn diff --git a/sdl2/bindings.scm b/sdl2/bindings.scm index 7f12b45..ac16481 100644 --- a/sdl2/bindings.scm +++ b/sdl2/bindings.scm @@ -206,6 +206,9 @@ RETURN-TYPE and accept arguments of ARG-TYPES." (define-foreign sdl-set-window-title void "SDL_SetWindowTitle" '(* *)) +(define-foreign sdl-set-window-icon + void "SDL_SetWindowIcon" (list '* '*)) + (define-foreign sdl-set-window-position void "SDL_SetWindowPosition" (list '* int int)) diff --git a/sdl2/video.scm b/sdl2/video.scm index a481183..0db5314 100644 --- a/sdl2/video.scm +++ b/sdl2/video.scm @@ -50,6 +50,7 @@ restore-window! set-window-border! set-window-title! + set-window-icon! set-window-position! set-window-size! set-window-minimum-size! @@ -231,6 +232,12 @@ the border." (ffi:sdl-set-window-title (unwrap-window window) (string->pointer title))) +(define (set-window-icon! window icon) + "Set the icon of WINDOW to the surface ICON." + (ffi:sdl-set-window-icon (unwrap-window window) + ((@@ (sdl2 surface) unwrap-surface) icon))) + + (define (set-window-position! window x y) "Set the position of WINDOW to (X, Y)." (ffi:sdl-set-window-position (unwrap-window window) x y)) |