Need urgent help, quick
My project is due in one week. I need to sort out a few things. I need to be able to set the positions of sliders like what happens in the itunes equalizer when you change settings.
I would also like to know how to make an NSwindow fullscreen so I can bypass the window manager and also how to keep a preview of the scene in my NSOpenglcontext when I minimize my window. When I minimize now, the context flushes and goes white. It reappears when I bring it back, but I would like a preview thing working.
Please hurry with your replies, I don't have much time.
I would also like to know how to make an NSwindow fullscreen so I can bypass the window manager and also how to keep a preview of the scene in my NSOpenglcontext when I minimize my window. When I minimize now, the context flushes and goes white. It reappears when I bring it back, but I would like a preview thing working.
Please hurry with your replies, I don't have much time.
I really just need the slider positioning. I tried using the setFloatValue method and it doesn't seem to do anything. Do I have to update the drawing or something?
I'm not certain, but do you have a connection between your function and your slider?
This works for me:
In IB, make sure that your class has an IBOutlet NSSlider *mySlider that you have connected properly. Now, whenever you need to change the sliders, just [mySlider setFloatValue:666.0];
Never gave me any trouble... :/
In IB, make sure that your class has an IBOutlet NSSlider *mySlider that you have connected properly. Now, whenever you need to change the sliders, just [mySlider setFloatValue:666.0];
Never gave me any trouble... :/
Quote:Originally posted by OSXRules
how to keep a preview of the scene in my NSOpenglcontext when I minimize my window. When I minimize now, the context flushes and goes white. It reappears when I bring it back, but I would like a preview thing working.
I have no idea why Apple can't get NSOpenGL content to minimize properly, especially now with Quartz Extreme. But the workaround is to copy your GL view into an NSImage, and draw that image over the Quartz content of your window. Here's my code from Untima, using a 640x400 view:
Code:
- (void) windowWillMiniaturize:(NSNotification *)notification {
[viewport lockFocus];
[offctx makeCurrentContext];
NSBitmapImageRep *minicon = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil
pixelsWide:640 pixelsHigh:400 bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO
isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:0 bitsPerPixel:0];
glReadPixels(0, 0, 640, 400, GL_RGB, GL_UNSIGNED_BYTE, [minicon bitmapData]);
[minicon drawInRect:[viewport bounds]];
[minicon release];
[viewport unlockFocus];
}Your image may appear upside down depending which way your viewport coordinate system is flipped.

