diff options
author | Sven Gothel <sgothel@jausoft.com> | 2010-11-15 03:53:22 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2010-11-15 03:53:22 +0100 |
commit | 35d1c40fe89311f88c7303930e172adcc5d6853a (patch) | |
tree | 383f74cbd782f32d194b7f893a5365fa86093ac7 /src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl | |
parent | 2c1a870f56f54df3e96d68e3d5dadee0bcae7cb5 (diff) |
NativeWindow AbstractGraphicsDevice: Add 'unitID' attribute and getUniqueID()
Preparation to support multiple devices on one machine,
hence adding the unitID a unique ID/index of the associated GPU, or GPU affinity.
Adding getUniqueID() to return a cached semantic unique string id for the device.
This was removed from the temp. impl in JOGL's GLContext, added unitID.
All other changes just adapt to the above.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl')
3 files changed, 5 insertions, 9 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java index 7981e7ba2..a8a82b46a 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -86,11 +86,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } catch (JogampRuntimeException jre) { /* n/a .. */ } } - /** FIXME: - * find out the Windows semantics of a device connection {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection()} - * to actually use multiple devices. - */ - defaultDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_CONNECTION); + defaultDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT); } static class SharedResource { @@ -156,7 +152,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } protected NativeSurface createOffscreenSurfaceImpl(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { - AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(); + AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX); ProxySurface ns = new ProxySurface(MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capabilities, chooser, screen, true)); ns.setSize(width, height); return ns; diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java index 973c67127..5dcc103b2 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java @@ -97,7 +97,7 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext { System.err.println("MacOSXExternalCGLContext Create "+caps); } - AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(); + AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX); MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps, pixelFormat); ProxySurface ns = new ProxySurface(cfg); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java index 6a9617d27..af8841d3d 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java @@ -62,7 +62,7 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GraphicsConfigurat } if(null==absScreen) { - absScreen = AWTGraphicsScreen.createScreenDevice(-1); + absScreen = AWTGraphicsScreen.createScreenDevice(-1, AbstractGraphicsDevice.DEFAULT_UNIT); } AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen; device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice(); @@ -83,7 +83,7 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GraphicsConfigurat long displayHandle = 0; - MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(); + MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT); DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex()); if(DEBUG) { System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: made "+macScreen); |