From e35b49595320a4e29037b9cf3a11ff81a9984d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 3 Apr 2014 13:57:22 +0200 Subject: Add sdl_window:hide/1 --- c_src/sdl_window.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'c_src/sdl_window.c') diff --git a/c_src/sdl_window.c b/c_src/sdl_window.c index 62d6993..887d84a 100644 --- a/c_src/sdl_window.c +++ b/c_src/sdl_window.c @@ -343,3 +343,20 @@ NIF_FUNCTION(get_window_title) return nif_thread_call(env, thread_get_window_title, 1, NIF_RES_GET(Window, window_res)); } + +// hide_window + +NIF_CAST_HANDLER(thread_hide_window) +{ + SDL_HideWindow(args[0]); +} + +NIF_FUNCTION(hide_window) +{ + void* window_res; + + BADARG_IF(!enif_get_resource(env, argv[0], res_Window, &window_res)); + + return nif_thread_cast(env, thread_hide_window, 1, + NIF_RES_GET(Window, window_res)); +} -- cgit v1.2.3