From 3ef437e67966ccc538171e4190a8bbc83f3a5bda Mon Sep 17 00:00:00 2001 From: kahsa Date: Fri, 4 Mar 2022 20:39:38 +0900 Subject: [PATCH] sokol: reorder and add missing funcs (#13652) --- vlib/sokol/sapp/sapp_funcs.c.v | 51 ++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/vlib/sokol/sapp/sapp_funcs.c.v b/vlib/sokol/sapp/sapp_funcs.c.v index 6f8b45e7f3..ec541629dc 100644 --- a/vlib/sokol/sapp/sapp_funcs.c.v +++ b/vlib/sokol/sapp/sapp_funcs.c.v @@ -32,6 +32,12 @@ fn C.sapp_show_keyboard(visible bool) // return true if the mobile device onscreen keyboard is currently shown fn C.sapp_keyboard_shown() bool +// Check if full screen rendering +fn C.sapp_is_fullscreen() bool + +// Toggle full screen +fn C.sapp_toggle_fullscreen() + // show or hide the mouse cursor fn C.sapp_show_mouse(visible bool) @@ -74,6 +80,18 @@ fn C.sapp_set_clipboard_string(str &byte) // read string from clipboard (usually during SAPP_EVENTTYPE_CLIPBOARD_PASTED) fn C.sapp_get_clipboard_string() &byte +// set the window title (only on desktop platforms) +fn C.sapp_set_window_title(&char) + +// /* set the window icon (only on Windows and Linux) */ +// SOKOL_APP_API_DECL void sapp_set_icon(const sapp_icon_desc* icon_desc); + +// Get number of droped files +fn C.sapp_get_num_dropped_files() int + +// Get the file path of the droped file +fn C.sapp_get_dropped_file_path(int) &byte + // special run-function for SOKOL_NO_ENTRY (in standard mode this is an empty stub) fn C.sapp_run(desc &Desc) int @@ -83,6 +101,12 @@ fn C.sapp_gles2() bool // HTML5: enable or disable the hardwired "Leave Site?" dialog box fn C.sapp_html5_ask_leave_site(ask bool) +// /* HTML5: get byte size of a dropped file */ +// SOKOL_APP_API_DECL uint32_t sapp_html5_get_dropped_file_size(int index); + +// /* HTML5: asynchronously load the content of a dropped file */ +// SOKOL_APP_API_DECL void sapp_html5_fetch_dropped_file(const sapp_html5_fetch_request* request); + // Metal: get ARC-bridged pointer to Metal device object fn C.sapp_metal_get_device() voidptr @@ -104,6 +128,9 @@ fn C.sapp_d3d11_get_device() voidptr // D3D11: get pointer to ID3D11DeviceContext object fn C.sapp_d3d11_get_device_context() voidptr +// D3D11: get pointer to IDXGISwapChain object +fn C.sapp_d3d11_get_swap_chain() voidptr + // D3D11: get pointer to ID3D11RenderTargetView object fn C.sapp_d3d11_get_render_target_view() voidptr @@ -113,17 +140,17 @@ fn C.sapp_d3d11_get_depth_stencil_view() voidptr // Win32: get the HWND window handle fn C.sapp_win32_get_hwnd() voidptr +// WebGPU: get WGPUDevice handle +fn C.sapp_wgpu_get_device() voidptr + +// WebGPU: get swapchain's WGPUTextureView handle for rendering +fn C.sapp_wgpu_get_render_view() voidptr + +// WebGPU: get swapchain's MSAA-resolve WGPUTextureView (may return null) +fn C.sapp_wgpu_get_resolve_view() voidptr + +// WebGPU: get swapchain's WGPUTextureView for the depth-stencil surface +fn C.sapp_wgpu_get_depth_stencil_view() 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 - -// Get number of droped files -fn C.sapp_get_num_dropped_files() int - -// Get the file path of the droped file -fn C.sapp_get_dropped_file_path(int) &byte