+ buffer_ = CoreSurfaceBufferCreate((CFDictionaryRef) [NSDictionary dictionaryWithObjectsAndKeys:
+ @"PurpleEDRAM", kCoreSurfaceBufferMemoryRegion,
+ [NSNumber numberWithBool:YES], kCoreSurfaceBufferGlobal,
+ [NSNumber numberWithInt:(width_ * BytesPerPixel)], kCoreSurfaceBufferPitch,
+ [NSNumber numberWithInt:width_], kCoreSurfaceBufferWidth,
+ [NSNumber numberWithInt:height_], kCoreSurfaceBufferHeight,
+ [NSNumber numberWithInt:'BGRA'], kCoreSurfaceBufferPixelFormat,
+ [NSNumber numberWithInt:(width_ * height_ * BytesPerPixel)], kCoreSurfaceBufferAllocSize,
+ nil]);
+
+ //screen_->frameBuffer = reinterpret_cast<char *>(mmap(NULL, sizeof(rfbPixel) * width_ * height_, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE | MAP_NOCACHE, VM_FLAGS_PURGABLE, 0));
+
+ CoreSurfaceBufferLock(buffer_, 3);
+ screen_->frameBuffer = reinterpret_cast<char *>(CoreSurfaceBufferGetBaseAddress(buffer_));
+ CoreSurfaceBufferUnlock(buffer_);