From 8dcb27a11db930f2d5b8a1eb5ed05f89be2b67b0 Mon Sep 17 00:00:00 2001 From: penguindark <57967770+penguindark@users.noreply.github.com> Date: Mon, 30 Aug 2021 16:10:14 +0200 Subject: [PATCH] sokol: expose the toggle_fullscreen and is_fullscreen functions (#11339) --- vlib/sokol/sapp/sapp.c.v | 12 ++++++++++++ vlib/sokol/sapp/sapp_funcs.c.v | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/vlib/sokol/sapp/sapp.c.v b/vlib/sokol/sapp/sapp.c.v index 6ee9cde57e..28b756248f 100644 --- a/vlib/sokol/sapp/sapp.c.v +++ b/vlib/sokol/sapp/sapp.c.v @@ -233,3 +233,15 @@ pub fn win32_get_hwnd() voidptr { pub fn android_get_native_activity() voidptr { return voidptr(C.sapp_android_get_native_activity()) } + +// Toggle full screen +[inline] +pub fn toggle_fullscreen() { + C.sapp_toggle_fullscreen() +} + +// Check if full screen rendering +[inline] +pub fn is_fullscreen() bool { + return C.sapp_is_fullscreen() +} diff --git a/vlib/sokol/sapp/sapp_funcs.c.v b/vlib/sokol/sapp/sapp_funcs.c.v index aae95c8e1e..3d177bda33 100644 --- a/vlib/sokol/sapp/sapp_funcs.c.v +++ b/vlib/sokol/sapp/sapp_funcs.c.v @@ -103,3 +103,9 @@ fn C.sapp_win32_get_hwnd() voidptr // Android: get native activity handle fn C.sapp_android_get_native_activity() voidptr + +// Toggle full screen +fn C.sapp_toggle_fullscreen() + +// Check if full screen rendering +fn C.sapp_is_fullscreen() bool