crasher and child window fixes

This commit is contained in:
Christopher Lloyd 2012-01-23 09:11:53 -05:00
parent 77beebf4ef
commit 592c5a3a2e
2 changed files with 8 additions and 9 deletions

View File

@ -120,10 +120,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
- (void)lockFocus {
[super lockFocus];
// create if needed
NSOpenGLContext *context = [self openGLContext];
CGLLockContext([_context CGLContextObj]);
CGLLockContext([context CGLContextObj]);
[_context setView:self];
[[self openGLContext] makeCurrentContext];
[context makeCurrentContext];
if (_needsReshape){
[self reshape];

View File

@ -90,7 +90,7 @@ static LRESULT CALLBACK windowProcedure(HWND handle,UINT message,WPARAM wParam,L
if(message==WM_PAINT){
Win32Window *parentWindow=GetProp(handle,"Win32Window");
#if 0
#if 1
ValidateRect(handle, NULL);
return [parentWindow WM_APP1_wParam:wParam lParam:lParam];
@ -572,9 +572,6 @@ CGL_EXPORT CGLError CGLUnlockContext(CGLContextObj context) {
}
static BOOL usesChildWindow(CGLContextObj context){
if(context->forceChildWindow)
return YES;
Win32Window *parentWindow=[CGWindow windowWithWindowNumber:context->parentWindowNumber];
if(parentWindow==nil)
@ -583,7 +580,7 @@ static BOOL usesChildWindow(CGLContextObj context){
if([parentWindow isLayeredWindow])
return NO;
return NO;
return context->forceChildWindow;
}
static BOOL shouldPutChildInParent(CGLContextObj context) {