capturing the content of a SpriteKit SKView (or SKScene, SKNode) to an NSImage ?
capturing the content of a SpriteKit SKView (or SKScene, SKNode) to an NSImage ?
- Subject: capturing the content of a SpriteKit SKView (or SKScene, SKNode) to an NSImage ?
- From: Guillaume Laurent <email@hidden>
- Date: Sun, 19 Jan 2014 22:35:07 +0100
Hi,
Has anyone tried and succeeded in capturing the contents of an SKView to an NSImage ? Techniques working for a regular NSView won't work apparently because an SKView is based on OpenGL. I tried taking advantage of the fact that an SKScene is an SKEffectNode and used a custom CIFilter which would dump the content of its input image on demand, but when doing this :
NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithCIImage:self.inputImage];
NSData* imageData = [imageRep representationUsingType:NSPNGFileType properties:nil];
the call to NSBitmapImageRep:representationUsingType fails with
clCreateFromGLTexture() failed with error code = CL_INVALID_GL_OBJECT
any ideas ?
Thanks
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden