NSOpenGLView and resizable NSWindow problem
NSOpenGLView and resizable NSWindow problem
- Subject: NSOpenGLView and resizable NSWindow problem
- From: "Werner Sharp" <email@hidden>
- Date: Tue, 31 Oct 2006 11:21:48 -0800
- Thread-topic: NSOpenGLView and resizable NSWindow problem
I'm trying to programmatically create a NSOpenGLView inside a NSWindow
and I'm having trouble getting the NSOpenGLView to correct resize. This
is a simplified version of what I'm doing ...
NSRect myrect.... // 100, 100, 400, 500
unsigned int mask = titledwindow | resizable | closeable |
miniaturizable;
NSWindow *win = [NSWindow alloc] initWithContentRect:myrect styleMask:
mask backing: NSBackingStoreBuffered defer:NO];
MyGLView *view = [MyGLView] alloc] init;
[win setContentView: view];
[view setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
My GL drawing is very simple - basic GL setup including the viewport
plus a glClearColor and glFlush call. The viewport is using the view's
bounds (or frame) to set itself. On the first drawRect, everything
draws fine - a solid color is displayed in the entire window. But if I
resize the window larger, the GL content is limited to the original size
of the window. I can see the view's frame and bound value match the
frame and bounds of the window itself but the GL rendering just appears
clipped to the original size.
My openGL view class does nothing besides override drawRect. Do I
need to override anything else to correctly resize the openglview? I
tried resizeWithOldSuperviewSize and can see resize calls happening but
my own experimental implementation of this does not help.
Thanks for any help.
Werner Sharp
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden