1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

sokol.sapp,gg: add support for drag & drop events (#11359)

This commit is contained in:
penguindark
2021-09-01 08:21:27 +02:00
committed by GitHub
parent 56993b9e2d
commit 63ff5690ff
5 changed files with 27 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ pub enum EventType {
update_cursor
quit_requested
clipboard_pasted
files_droped
num
}

View File

@@ -245,3 +245,15 @@ pub fn toggle_fullscreen() {
pub fn is_fullscreen() bool {
return C.sapp_is_fullscreen()
}
[inline]
pub fn get_num_dropped_files() int {
return C.sapp_get_num_dropped_files()
}
[inline]
pub fn get_dropped_file_path(index int) string {
unsafe {
return cstring_to_vstring(C.sapp_get_dropped_file_path(index))
}
}

View File

@@ -109,3 +109,9 @@ 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