Re: OpenGL & Cocoa Question
Re: OpenGL & Cocoa Question
- Subject: Re: OpenGL & Cocoa Question
- From: Marc Monticelli <email@hidden>
- Date: Fri, 18 May 2001 10:38:50 +0200
On Thursday, May 17, 2001, at 11:26 , Marc Monticelli wrote:
I have an OpenGLView in Cocoa application that works well the first
time its window appears.
If I close the window and reopen it, I've lost the context. I do a
makeCurrentContext, but the result is the same.
I have on the window, some "video noise" (I imagine my openglview)
I'm assuming that when you say 'close', you mean you end up releasing
the window and all its views.
No. The flag "release when close" is not set. When I call [win
makeKeyAndOrderfront:sender]; the window "reappear" with all controls
with the same variables berfore I close(the window is bufferized, but
not draw on the screen).
First, if you don't retain the context, it will be disposed of when the
view goes away.
Ok, I will do that
If you have created the context separately, you will need to associate
it with the new NSOpenGLView that is created in the new window. i.e.
call [myOpenGLContext setView:myOpenGLView];
thanks
...Marc