From: Jay Freeman (saurik) Date: Thu, 21 Aug 2008 06:16:10 +0000 (+0000) Subject: Port to 2.0. X-Git-Tag: v0.9.2591~5 X-Git-Url: https://git.saurik.com/veency.git/commitdiff_plain/445a5ee90cff428a13b9e49c39937d5d36139a94 Port to 2.0. --- diff --git a/iphonevnc/iPhoneVNC.mm b/iphonevnc/iPhoneVNC.mm index 94ae09c..eac7e0f 100644 --- a/iphonevnc/iPhoneVNC.mm +++ b/iphonevnc/iPhoneVNC.mm @@ -1,4 +1,3 @@ -#import #import #import @@ -6,6 +5,8 @@ #include #include +extern "C" UIImage *UIGetScreenImage(); + static const size_t Width = 320; static const size_t Height = 480; static const size_t BytesPerPixel = 4; @@ -52,9 +53,13 @@ int main(int argc, char *argv[]) { uint8_t *buffer1 = (uint8_t *) CGBitmapContextGetData(context1); screen->frameBuffer = (char *) buffer0; - CGImageRef image = LKPurpleServerGetScreenImage(NULL); - CGContextDrawImage(context0, rect, image); - CFRelease(image); + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + UIImageRef *image = UIGetScreenImage(); + CGImageRef ref = [image CGImage]; + CGContextDrawImage(context0, rect, ref); + + [pool release]; if (memcmp(buffer0, buffer1, Size8) != 0) rfbMarkRectAsModified(screen, 0, 0, Width, Height);