diff options
Diffstat (limited to 'c_src')
-rw-r--r-- | c_src/esdl2.h | 1 | ||||
-rw-r--r-- | c_src/sdl_window.c | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/c_src/esdl2.h b/c_src/esdl2.h index de6b800..9c41916 100644 --- a/c_src/esdl2.h +++ b/c_src/esdl2.h @@ -181,6 +181,7 @@ F(set_window_fullscreen, 2) \ F(set_window_grab, 2) \ F(set_window_icon, 2) \ + F(set_window_maximum_size, 3) \ // Generated declarations for the NIF. diff --git a/c_src/sdl_window.c b/c_src/sdl_window.c index b79cd4f..8507234 100644 --- a/c_src/sdl_window.c +++ b/c_src/sdl_window.c @@ -543,3 +543,23 @@ NIF_FUNCTION(set_window_icon) return nif_thread_call(env, thread_set_window_icon, 2, NIF_RES_GET(Window, window_res), NIF_RES_GET(Surface, surface_res)); } + +// set_window_maximum_size + +NIF_CAST_HANDLER(thread_set_window_maximum_size) +{ + SDL_SetWindowMaximumSize(args[0], (long)args[1], (long)args[2]); +} + +NIF_FUNCTION(set_window_maximum_size) +{ + void* window_res; + int w, h; + + BADARG_IF(!enif_get_resource(env, argv[0], res_Window, &window_res)); + BADARG_IF(!enif_get_int(env, argv[1], &w)); + BADARG_IF(!enif_get_int(env, argv[2], &h)); + + return nif_thread_cast(env, thread_set_window_maximum_size, 3, + NIF_RES_GET(Window, window_res), w, h); +} |