diff options
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)); +} |