From 83d3a3f2ea8dc328e621b3abbe671f46379c7e65 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 14 Nov 2010 09:04:45 +0100 Subject: JOGL: Complete eager and lazy mapping of GLProfiles in respect to multiple device. AbstractGraphicsDevice's 'connection' and 'type' attribute is used as a unique key to map GLProfiles and GLContext's major/profile -> major/minor/profile mapping. Eager initialiaztion as well as lazy is supported to maintain a simple API. This is currently tested on X11, where one app display NEWT/GL window and content on the local and remote device. See TestRemoteWindow01NEWT.java and TestRemoteGLWindows01NEWT.java --- src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 12 ++++++------ src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl/awt') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 9db718bfb..c0f2736fb 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -83,7 +83,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { static { DEBUG = Debug.debug("GLCanvas"); - defaultGLProfile = GLProfile.getDefault(); + defaultGLProfile = GLProfile.getDefault(GLProfile.getDefaultDesktopDevice()); } private GLProfile glProfile; @@ -795,11 +795,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { * A most simple JOGL AWT test entry */ public static void main(String args[]) { - System.err.println(GlueGenVersion.getInstance().getInfo(null)); - System.err.println(NativeWindowVersion.getInstance().getInfo(null)); - System.err.print(JoglVersion.getInstance().getInfo(null)); + System.err.println(GlueGenVersion.getInstance()); + System.err.println(NativeWindowVersion.getInstance()); + System.err.print(JoglVersion.getInstance()); - GLCapabilities caps = new GLCapabilities( GLProfile.getDefault() ); + GLCapabilities caps = new GLCapabilities( GLProfile.getDefault(GLProfile.getDefaultDesktopDevice()) ); Frame frame = new Frame("JOGL AWT Test"); GLCanvas glCanvas = new GLCanvas(caps); @@ -809,7 +809,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { glCanvas.addGLEventListener(new GLEventListener() { public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); - System.err.println(JoglVersion.getInstance().getGLInfo(gl, null)); + System.err.println(JoglVersion.getInstance().toString(gl)); } public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index b9bbf71c2..955e51e69 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -1275,7 +1275,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { public GLProfile getGLProfile() { // FIXME: should do better than this; is it possible to using only platform-independent code? - return GLProfile.getDefault(); + return GLProfile.getDefault(GLProfile.getDefaultDesktopDevice()); } public void handleReshape() { -- cgit v1.2.3