aboutsummaryrefslogtreecommitdiffstats
path: root/src/sdl_window.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-04-03 19:13:04 +0200
committerLoïc Hoguin <[email protected]>2014-04-03 19:21:31 +0200
commit3026b4860fd3a1436a59bf2d26792fbbf6b60917 (patch)
tree8b8e3b8aafcc3968ee8031293fa63f65fbac4f66 /src/sdl_window.erl
parentafc06a3ef6689bd86780c3df065d3ec8efa4bce8 (diff)
downloadesdl2-3026b4860fd3a1436a59bf2d26792fbbf6b60917.tar.gz
esdl2-3026b4860fd3a1436a59bf2d26792fbbf6b60917.tar.bz2
esdl2-3026b4860fd3a1436a59bf2d26792fbbf6b60917.zip
Add sdl_window:set_icon/2
The surface needs to be kept around and not GC otherwise it crashes.
Diffstat (limited to 'src/sdl_window.erl')
-rw-r--r--src/sdl_window.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sdl_window.erl b/src/sdl_window.erl
index 0da1e57..0232fc0 100644
--- a/src/sdl_window.erl
+++ b/src/sdl_window.erl
@@ -35,6 +35,7 @@
-export([set_brightness/2]).
-export([set_fullscreen/2]).
-export([grab_input/2]).
+-export([set_icon/2]).
create(Title, X, Y, W, H, Flags) ->
esdl2:create_window(Title, X, Y, W, H, Flags),
@@ -115,3 +116,7 @@ set_fullscreen(Window, Flag) ->
grab_input(Window, Grab) ->
esdl2:set_window_grab(Window, Grab).
+
+set_icon(Window, Surface) ->
+ esdl2:set_window_icon(Window, Surface),
+ receive {'_nif_thread_ret_', Ret} -> Ret end.