summaryrefslogtreecommitdiffstats
path: root/src/demos/context
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-12-20 08:58:42 +0000
committerKenneth Russel <[email protected]>2008-12-20 08:58:42 +0000
commit169e8a51a4a6a7b0fa2e72970ec66a405238bcd3 (patch)
treeae01f475aaffb0497c6b72127f1f8ca62362d82a /src/demos/context
parent508e3d6c5948da6838d8288706d4dc16e23c58c3 (diff)
Factored out the remaining toolkit, and specifically AWT, dependencies
from GLDrawableFactory implementations into NativeWindowFactory implementations. These dependencies were the up-front selection of the GraphicsConfiguration and the locking and unlocking of the toolkit, which are both currently needed only on X11 platforms due to how OpenGL and the window system interact there. Added X11GraphicsDevice and X11GraphicsConfiguration classes which are intended to be used by Newt or potentially other third-party window toolkits. Unified the separate NativeWindow and AWT GLDrawableFactory implementations in the GLDrawableFactory class. Exposed the toolkit locking mechanism through the NativeWindowFactory and introduced the concept of a default NativeWindowFactory which is used by the X11 drawable and context implementations. Removed unnecessary toolkit locking calls from Mac OS X and Windows drawable and context implementations. Added a registration mechanism for new NativeWindowFactories, allowing third parties to plug in new window toolkits orthogonally to the OpenGL drawable and context code. The public APIs for the NativeWindowFactory and the GLDrawableFactory, in particular how they are fetched, changed as a result of these refactorings. Updated all uses. Fixed bug in X11OffscreenGLXDrawable introduced during last set of changes. Tested demos on Solaris, Mac OS X and Windows. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@306 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/context')
-rwxr-xr-xsrc/demos/context/DualContext.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/demos/context/DualContext.java b/src/demos/context/DualContext.java
index 34b635b..898d08f 100755
--- a/src/demos/context/DualContext.java
+++ b/src/demos/context/DualContext.java
@@ -71,8 +71,8 @@ public class DualContext extends Canvas {
public DualContext(GLCapabilities capabilities) {
super(unwrap((AWTGraphicsConfiguration)
- GLDrawableFactory.getFactory().chooseGraphicsConfiguration(capabilities, null, null)));
- NativeWindow win = NativeWindowFactory.getNativeWindow(this);
+ NativeWindowFactory.getFactory(Canvas.class).chooseGraphicsConfiguration(capabilities, null, null)));
+ NativeWindow win = NativeWindowFactory.getFactory(getClass()).getNativeWindow(this);
drawable = GLDrawableFactory.getFactory().createGLDrawable(win, capabilities, null);
context1 = drawable.createContext(null);
context2 = drawable.createContext(null);