Re: Going around "display:"
Re: Going around "display:"
- Subject: Re: Going around "display:"
- From: "Erik M. Buck" <email@hidden>
- Date: Sat, 18 May 2002 22:19:50 -0500
- Organization: EMB & Assocites Inc.
Yes, you are doing something wrong.
If you can call
>
[myView lockFocus];
>
[self drawMethod];
>
[myView unlockFocus];
then you can call
[self displayInRect:someRect];
The -display method does a lot of setup and helps the App kit do the most
efficient drawing with buffers swaps during v-blank etc. If you are full
screen, you do not have to worry about it and you don't need NSOpenGLView at
all.
----- Original Message -----
From: "David Newberry" <email@hidden>
To: <email@hidden>
Sent: Saturday, May 18, 2002 5:39 PM
Subject: Going around "display:"
>
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.
_______________________________________________
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.