示例#1
0
文件: navi.go 项目: mysll/flynet
func CreateNavitation(mapid int, path string, file string, maptyp int) int {
	cpath := C.CString(path)
	cfile := C.CString(file)
	defer C.Free(unsafe.Pointer(cpath))
	defer C.Free(unsafe.Pointer(cfile))
	res := C.CreateNavigation(C.int(mapid), cpath, cfile, C.int(maptyp))
	return int(res)
}
示例#2
0
// ScreenShot takes a screenshot and returns it in jpeg format with given
// quality. This is not threadsafe.
func ScreenShot(quality float64) ([]byte, error) {
	C.JPEG(C.float(quality))
	data := (*[1 << 30]byte)(unsafe.Pointer(C.Data()))[0:C.Length()]
	newData := make([]byte, C.Length())
	copy(newData, data)
	C.Free()
	return newData, nil
}
示例#3
0
func Clean() {
	C.Free()
}