Update Go sources

This commit is contained in:
Milan Nikolic 2022-08-27 16:09:36 +02:00
parent b126ec93ee
commit 70200c3151
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
10 changed files with 39 additions and 120 deletions

View file

@ -71,13 +71,13 @@ func IsFileDropped() bool {
return v
}
// GetDroppedFiles - Retrieve dropped files into window
func GetDroppedFiles(count *int32) []string {
ccount := (*C.int)(unsafe.Pointer(count))
ret := C.GetDroppedFiles(ccount)
// LoadDroppedFiles - Load dropped filepaths
func LoadDroppedFiles() []string {
ret := C.LoadDroppedFiles()
defer C.UnloadDroppedFiles(ret)
tmpslice := (*[1 << 24]*C.char)(unsafe.Pointer(ret))[:*count:*count]
gostrings := make([]string, *count)
tmpslice := (*[1 << 24]*C.char)(unsafe.Pointer(ret.paths))[:ret.count:ret.count]
gostrings := make([]string, ret.count)
for i, s := range tmpslice {
gostrings[i] = C.GoString(s)
}
@ -85,9 +85,9 @@ func GetDroppedFiles(count *int32) []string {
return gostrings
}
// ClearDroppedFiles - Clear dropped files paths buffer
func ClearDroppedFiles() {
C.ClearDroppedFiles()
// UnloadDroppedFiles - Unload dropped filepaths
func UnloadDroppedFiles() {
return
}
// OpenAsset - Open asset