Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?
Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?
- Subject: Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?
- From: Clay Heaton <email@hidden>
- Date: Tue, 22 Jan 2013 11:16:04 -0500
That's actually what I'm doing at the moment:
NSApplicationPresentationOptions options = NSApplicationPresentationHideDock + NSApplicationPresentationDisableProcessSwitching + NSApplicationPresentationHideMenuBar;
NSNumber *presentationOptions = [NSNumber numberWithUnsignedLong:options];
NSArray *keys = [NSArray arrayWithObjects:@"NSFullScreenModeAllScreens", @"NSFullScreenModeApplicationPresentationOptions", nil];
NSArray *values = [NSArray arrayWithObjects:[NSNumber numberWithBool:YES], presentationOptions, nil];
NSDictionary *fullScreenOptions = [[NSDictionary alloc] initWithObjects:values forKeys:keys];
[glView_ enterFullScreenMode:[NSScreen mainScreen] withOptions:fullScreenOptions];
There are a few problems:
- The F4 key still allows process switching (Kiosk mode bug with NSApplicationPresentationDisableProcessSwitching; radar ID 12358575)
- The function keys still pass through to the system (iTunes, brightness, etc.)
The application is for toddlers (https://itunes.apple.com/us/app/toddler-typer/id566326332?mt=12). Several months of use and feedback show that they find and find joy from pressing the keys that pass through to the system. Since I'm trying to create an environment where they won't mess up anything on the computer, I don't really want them switching processes, etc.
I tried to subclass NSApplication to capture the system keys, but they are dispatched to the system regardless of what I do therein.
Hence, I was trying to capture the screen. Any other ideas?
Thanks,
Clay
On Jan 22, 2013, at 11:00 AM, Kyle Sluder <email@hidden> wrote:
> On Tue, Jan 22, 2013, at 07:50 AM, Clay Heaton wrote:
>>
>> I've read through the Apple display capturing guide, yet I always end up
>> with a black screen (instead of the proper contents of my NSOpenGLView)
>> when I try to capture the display. I suspect that I'm not assigning the
>> proper context when using CGDisplayCapture(), but I'm getting confused
>> with contexts and can't figure out what's gone awry.
>
> Don't capture the display. It's discouraged nowadays because it will
> prevent the user from seeing important things like the "Your battery is
> about to die" message. It also doesn't get you any net performance gain;
> fullscreen OpenGL contexts have been deprecated for a couple OS releases
> now.
>
> Send -enterFullScreenMode:withPresentationOptions: to your OpenGL view.
> You can pass a ton of arguments to it to disable the menu bar, app
> switching, etc. If you want to render at a lower resolution than the
> display, render to a texture of the appropriate size and then draw that
> texture in a fullscreen quad.
>
> --Kyle Sluder
_______________________________________________
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