From 0a92a47567cfa36b33590bacf4c782c0ec4f9eaf Mon Sep 17 00:00:00 2001 From: sg215889 Date: Tue, 28 Jul 2009 15:49:12 -0700 Subject: Fix BroadcomEGL: Proper EGLGraphicsConfiguration at creation time --- .../com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/newt/classes') diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java index a91a91598..9b790bd1f 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java +++ b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java @@ -50,8 +50,12 @@ public class BCEGLWindow extends Window { } protected void createNative(Capabilities caps) { - // just save the GLProfile here, create window later .. - glProfile = ((GLCapabilities)caps).getGLProfile(); + // query a good configuration .. even thought we drop this one + // and reuse the EGLUtil choosen one later. + config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen()); + if (config == null) { + throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this); + } } protected void closeNative() { @@ -115,12 +119,12 @@ public class BCEGLWindow extends Window { private void windowCreated(int cfgID, int width, int height) { this.width = width; this.height = height; - config = EGLGraphicsConfiguration.create(glProfile, screen.getGraphicsScreen(), cfgID); + GLCapabilities capsReq = (GLCapabilities) config.getRequestedCapabilities(); + config = EGLGraphicsConfiguration.create(capsReq, screen.getGraphicsScreen(), cfgID); if (config == null) { throw new NativeWindowException("Error creating EGLGraphicsConfiguration from id: "+cfgID+", "+this); } } private long windowHandleClose; - private GLProfile glProfile; } -- cgit v1.2.3