Ejemplo n.º 1
0
Archivo: navi.go Proyecto: 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)
}
Ejemplo n.º 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
}
Ejemplo n.º 3
0
func Clean() {
	C.Free()
}