From 84b4ea732c0f2a54bbbe664e50e1af314a0bdb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 3 Apr 2014 13:28:10 +0200 Subject: Add sdl_window:get_min_size/1 --- c_src/sdl_window.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'c_src/sdl_window.c') diff --git a/c_src/sdl_window.c b/c_src/sdl_window.c index 0983370..242763e 100644 --- a/c_src/sdl_window.c +++ b/c_src/sdl_window.c @@ -254,3 +254,27 @@ NIF_FUNCTION(get_window_maximum_size) return nif_thread_call(env, thread_get_window_maximum_size, 1, NIF_RES_GET(Window, window_res)); } + +// get_window_minimum_size + +NIF_CALL_HANDLER(thread_get_window_minimum_size) +{ + int w, h; + + SDL_GetWindowMinimumSize(args[0], &w, &h); + + return enif_make_tuple2(env, + enif_make_int(env, w), + enif_make_int(env, h) + ); +} + +NIF_FUNCTION(get_window_minimum_size) +{ + void* window_res; + + BADARG_IF(!enif_get_resource(env, argv[0], res_Window, &window_res)); + + return nif_thread_call(env, thread_get_window_minimum_size, 1, + NIF_RES_GET(Window, window_res)); +} -- cgit v1.2.3