From 445a5ee90cff428a13b9e49c39937d5d36139a94 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 21 Aug 2008 06:16:10 +0000 Subject: [PATCH] Port to 2.0. --- iphonevnc/iPhoneVNC.mm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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); -- 2.50.0