VideoOutputView registers for window resize notification it's in so it can update it's drawable object
This commit is contained in:
parent
1097dec1c6
commit
0f35f0e41d
|
@ -160,15 +160,22 @@
|
|||
|
||||
#ifdef HAVE_OPENGL
|
||||
- (void)viewDidMoveToWindow
|
||||
{
|
||||
//the setView message doesnt work if the view
|
||||
//isn't in a window, which is the case in the init func
|
||||
//so we use this callback to bind the context to the window
|
||||
{//if the view moves to another window we need to update the drawable object
|
||||
|
||||
if(!context)return;
|
||||
|
||||
//withdraw from recieving updates on previously window, if any
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:context];
|
||||
|
||||
if([self window] != nil)
|
||||
{
|
||||
[context setView:self];
|
||||
else
|
||||
[context clearDrawable];
|
||||
|
||||
//udpate drawable if the window changed
|
||||
[[NSNotificationCenter defaultCenter] addObserver:context selector:@selector(update) name:@"NSWindowDidResizeNotification" object:[self window]];
|
||||
|
||||
} else [context clearDrawable];
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -198,8 +205,8 @@
|
|||
{
|
||||
[super setFrame:rect];
|
||||
|
||||
[context update];
|
||||
[context makeCurrentContext];
|
||||
[context update];
|
||||
|
||||
//set the viewport (so the raster pos will be correct)
|
||||
glViewport(0, 0, rect.size.width, rect.size.height);
|
||||
|
@ -275,6 +282,7 @@
|
|||
[screen_buffer rotateTo0];
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
|
|
Loading…
Reference in New Issue