diff options
author | Kevin Barnes <krbarnes> | 2008-08-21 16:40:56 +0000 |
---|---|---|
committer | Kevin Barnes <krbarnes> | 2008-08-21 16:40:56 +0000 |
commit | 44efb8e7eb796293a09dff33329e54074288f821 (patch) | |
tree | 7b03f5d28797d3cc88985c046f8e4cc765568271 /bundles/org.eclipse.swt/Eclipse SWT OpenGL | |
parent | bf5c8b81d42eec4571c559ba1d3088600b46768f (diff) | |
download | eclipse.platform.swt-44efb8e7eb796293a09dff33329e54074288f821.tar.gz eclipse.platform.swt-44efb8e7eb796293a09dff33329e54074288f821.tar.xz eclipse.platform.swt-44efb8e7eb796293a09dff33329e54074288f821.zip |
196884 - [OpenGL] GLCanvas doesn't work on Vista
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OpenGL')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/opengl/GLCanvas.java | 14 |
1 files changed, 12 insertions, 2 deletions
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 ec343b441e..e554520010 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 @@ -28,7 +28,7 @@ import org.eclipse.swt.internal.opengl.win32.*; public class GLCanvas extends Canvas { int /*long*/ context; int pixelFormat; - + static final String USE_OWNDC_KEY = "org.eclipse.swt.internal.win32.useOwnDC"; //$NON-NLS-1$ /** * Create a GLCanvas widget using the attributes described in the GLData * object provided. @@ -43,7 +43,8 @@ public class GLCanvas extends Canvas { * </ul> */ public GLCanvas (Composite parent, int style, GLData data) { - super (parent, style); + super (parent, checkStyle (parent, style)); + parent.getDisplay ().setData (USE_OWNDC_KEY, new Boolean (false)); if (data == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); PIXELFORMATDESCRIPTOR pfd = new PIXELFORMATDESCRIPTOR (); pfd.nSize = (short) PIXELFORMATDESCRIPTOR.sizeof; @@ -103,6 +104,15 @@ public GLCanvas (Composite parent, int style, GLData data) { addListener (SWT.Dispose, listener); } +static int checkStyle(Composite parent, int style) { + if (parent != null) { + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { + parent.getDisplay ().setData (USE_OWNDC_KEY, new Boolean (true)); + } + } + return style; +} + /** * Returns a GLData object describing the created context. * |