• 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
Going around "display:"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Going around "display:"


  • Subject: Going around "display:"
  • From: David Newberry <email@hidden>
  • Date: Sat, 18 May 2002 15:39:05 -0700

Hello all,

I am working with a subclass of NSView (specifically NSOpenGLView). It's a simple game, and I want to invoke OpenGL drawing code from a place in the program other than my NSOpenGLView's subclass' drawRect: method. (Having it there just doesn't make sense in how the flow of my program is set up.) To get around having drawing code in said method, I have the following code:

[myView lockFocus];
[self drawMethod];
[myView unlockFocus];

What I'm trying to do is probably fairly obvious. "myView" is my NSView subclass, and this code is being called from the object containing the drawing code in the "drawMethod" method. It seems that the code is being called properly (from a timer), but the NSOpenGLView is not being drawn to the screen... only if I force the drawRect: method to be called does it update on screen. Am I doing something incorrectly, or overlooking something else I need to call?

Thanks in advance,
-David Newberry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Going around "display:"
      • From: "Erik M. Buck" <email@hidden>
    • sound CFURL in CFUserNotificationDisplayAlert question
      • From: Charles Bennett <email@hidden>
  • Prev by Date: Re: NSOutlineView and datasource
  • Next by Date: Re: Dock Magnification Effect
  • Previous by thread: Help w/ NSPICTImageRep, NSQuickdrawView & offscreen drawing
  • Next by thread: sound CFURL in CFUserNotificationDisplayAlert question
  • Index(es):
    • Date
    • Thread