diff options
author | Kenneth Russel <kbrussel@alum.mit.edu> | 2005-07-18 21:28:48 +0000 |
---|---|---|
committer | Kenneth Russel <kbrussel@alum.mit.edu> | 2005-07-18 21:28:48 +0000 |
commit | 9f3bf8307320cf80f67e0af707614f0304507731 (patch) | |
tree | 117f6338d05a00d4fe8687952e53a913bdab2568 /src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java | |
parent | 6f2bdbacf131b05937925fbfe32ac0b603ccbcc6 (diff) |
Implemented pbuffer instantiation support in GLDrawableFactory rather
than GLCanvas on Windows. Restructured GLJPanel and jogl-demos to use
new APIs. Still needs to be ported to other platforms.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@104 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java')
-rw-r--r-- | src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java index cd70062..a59b208 100644 --- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java +++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java @@ -234,7 +234,11 @@ public class HWShadowmapsSimple { // init pbuffer GLCapabilities caps = new GLCapabilities(); caps.setDoubleBuffered(false); - pbuffer = drawable.createOffscreenDrawable(caps, TEX_SIZE, TEX_SIZE); + + if (!GLDrawableFactory.getFactory().canCreateGLPbuffer(caps, TEX_SIZE, TEX_SIZE)) { + unavailableExtension("Can not create pbuffer"); + } + pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, TEX_SIZE, TEX_SIZE, drawable.getContext()); pbuffer.addGLEventListener(new PbufferListener()); // Register the window with the ManipManager @@ -344,11 +348,15 @@ public class HWShadowmapsSimple { private void checkExtension(GL gl, String extensionName) { if (!gl.isExtensionAvailable(extensionName)) { String message = "Unable to initialize " + extensionName + " OpenGL extension"; - JOptionPane.showMessageDialog(null, message, "Unavailable extension", JOptionPane.ERROR_MESSAGE); - throw new GLException(message); + unavailableExtension(message); } } + private void unavailableExtension(String message) { + JOptionPane.showMessageDialog(null, message, "Unavailable extension", JOptionPane.ERROR_MESSAGE); + throw new GLException(message); + } + private void dispatchKey(char k) { switch (k) { case 27: |