From 0894512a66f007a1e9c59f8caa85551e06c6fecf Mon Sep 17 00:00:00 2001 From: Steve Northover Date: Wed, 18 Apr 2007 05:51:16 +0000 Subject: 182810 - GLCanvas.isCurrent() always returns false on Windows --- .../win32/org/eclipse/swt/opengl/GLCanvas.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bundles') diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/opengl/GLCanvas.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/opengl/GLCanvas.java index e53e611cb4..d599af3647 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/opengl/GLCanvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/opengl/GLCanvas.java @@ -90,9 +90,9 @@ public GLCanvas (Composite parent, int style, GLData data) { Listener listener = new Listener () { public void handleEvent (Event event) { switch (event.type) { - case SWT.Dispose: - WGL.wglDeleteContext (context); - break; + case SWT.Dispose: + WGL.wglDeleteContext (context); + break; } } }; @@ -144,7 +144,7 @@ public GLData getGLData () { */ public boolean isCurrent () { checkWidget (); - return WGL.wglGetCurrentContext () == handle; + return WGL.wglGetCurrentContext () == context; } /** @@ -158,7 +158,7 @@ public boolean isCurrent () { */ public void setCurrent () { checkWidget (); - if (WGL.wglGetCurrentContext () == handle) return; + if (WGL.wglGetCurrentContext () == context) return; int hDC = OS.GetDC (handle); WGL.wglMakeCurrent (hDC, context); OS.ReleaseDC (handle, hDC); -- cgit