back/win32: Fix for multiple NSOpenGLView's

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29940 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2010-03-14 06:50:31 +00:00
parent 36260d2295
commit 1561ba0aec
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,12 @@
2010-03-13 Eric Wasylishen <ewasylishen@gmail.com>
* Source/win32/w32_GLcontext.m:
Make more than one NSOpenGLView in an application work.
Win32GLContext was using the hDC stored in the pixel format
object in a few places, instead of getting it from the
Win32Subwindow object.
2010-03-13 Eric Wasylishen <ewasylishen@gmail.com>
* Headers/win32/WIN32Server.h:

View file

@ -269,7 +269,7 @@ static Win32GLContext *currentGLContext;
{
[Win32GLContext clearCurrentContext];
}
format->wgl_drawable = (HDC)NULL;
wsubwin->hDC = (HDC)NULL;
DESTROY(wsubwin);
}
}
@ -306,7 +306,7 @@ static Win32GLContext *currentGLContext;
- (void)flushBuffer
{
SwapBuffers(format->wgl_drawable);
SwapBuffers(wsubwin->hDC);
}
- (void)getValues:(long *)vals
@ -360,11 +360,11 @@ static Win32GLContext *currentGLContext;
[NSException raise: NSGenericException
format: @"GL Context is not bind, cannot be made current"];
NSAssert(wgl_context && format->wgl_drawable,
NSAssert(wgl_context && wsubwin->hDC,
NSInternalInconsistencyException);
NSDebugMLLog(@"WGL", @"before wglMakeCurrent");
wglMakeCurrent(format->wgl_drawable, wgl_context);
wglMakeCurrent(wsubwin->hDC, wgl_context);
NSDebugMLLog(@"WGL", @"after wglMakeCurrent");
// NSAssert(glx_context != None, NSInternalInconsistencyException);