• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSOpenGLView and resizable NSWindow problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSOpenGLView and resizable NSWindow problem
      • From: Simone Tellini <email@hidden>
  • Prev by Date: Re: Can you populate an NSTableView with an NSEnumerator?
  • Next by Date: Display a NSView under another NSView
  • Previous by thread: Re: Can you populate an NSTableView with an NSEnumerator?
  • Next by thread: Re: NSOpenGLView and resizable NSWindow problem
  • Index(es):
    • Date
    • Thread