diff options
author | Loïc Hoguin <[email protected]> | 2014-04-03 20:16:59 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-04-03 20:16:59 +0200 |
commit | 305e52b41717adbfc30ac937994f9bec7db68b86 (patch) | |
tree | 79abb3fe3e23daf5fb1caef319fa0bbcb55bc39a /c_src | |
parent | 0f31316fc0e67d9f00638b913ac91d3009c47e94 (diff) | |
download | esdl2-305e52b41717adbfc30ac937994f9bec7db68b86.tar.gz esdl2-305e52b41717adbfc30ac937994f9bec7db68b86.tar.bz2 esdl2-305e52b41717adbfc30ac937994f9bec7db68b86.zip |
Add sdl_window:show/1
Diffstat (limited to 'c_src')
-rw-r--r-- | c_src/esdl2.h | 1 | ||||
-rw-r--r-- | c_src/sdl_window.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/c_src/esdl2.h b/c_src/esdl2.h index 2a0a231..06d1203 100644 --- a/c_src/esdl2.h +++ b/c_src/esdl2.h @@ -186,6 +186,7 @@ F(set_window_position, 3) \ F(set_window_size, 3) \ F(set_window_title, 2) \ + F(show_window, 1) // Generated declarations for the NIF. diff --git a/c_src/sdl_window.c b/c_src/sdl_window.c index 065e39a..c35fb0c 100644 --- a/c_src/sdl_window.c +++ b/c_src/sdl_window.c @@ -644,3 +644,20 @@ NIF_FUNCTION(set_window_title) return nif_thread_cast(env, thread_set_window_title, 2, NIF_RES_GET(Window, window_res), title); } + +// show_window + +NIF_CAST_HANDLER(thread_show_window) +{ + SDL_ShowWindow(args[0]); +} + +NIF_FUNCTION(show_window) +{ + void* window_res; + + BADARG_IF(!enif_get_resource(env, argv[0], res_Window, &window_res)); + + return nif_thread_cast(env, thread_show_window, 1, + NIF_RES_GET(Window, window_res)); +} |