aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-02-23 22:42:27 +0000
committerKenneth Russel <[email protected]>2005-02-23 22:42:27 +0000
commit275675c380de6b4583993998cafe29ef469a1a86 (patch)
treee299a0940ce8683ed397de05d69fede988dc34bc /src
parent5badb8802c2c4f884a81970321361b99aa23aca2 (diff)
Partial fix for Issue 114: GLCanvas canCreateOffscreenDrawable() function always returns true
Fixed the Windows implementation of this routine to check for the presence of the WGL_ARB_pbuffer and WGL_ARB_pixel_format extensions. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@238 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r--src/net/java/games/jogl/GLDrawable.java4
-rw-r--r--src/net/java/games/jogl/impl/windows/WindowsGLContext.java7
-rw-r--r--src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/net/java/games/jogl/GLDrawable.java b/src/net/java/games/jogl/GLDrawable.java
index aadc2b4fc..7c671c0b2 100644
--- a/src/net/java/games/jogl/GLDrawable.java
+++ b/src/net/java/games/jogl/GLDrawable.java
@@ -190,7 +190,9 @@ public interface GLDrawable extends ComponentEvents {
/** Indicates whether this drawable is capable of fabricating a
subordinate offscreen drawable for advanced rendering techniques
- which require offscreen hardware-accelerated surfaces. */
+ which require offscreen hardware-accelerated surfaces. Note that
+ this method is only guaranteed to return a correct result once
+ your GLEventListener's init() method has been called. */
public boolean canCreateOffscreenDrawable();
/** Creates a subordinate offscreen drawable (pbuffer) for this
diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java
index d26a88cc7..37a3f5359 100644
--- a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java
+++ b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java
@@ -61,6 +61,7 @@ public abstract class WindowsGLContext extends GLContext {
private GLProcAddressTable glProcAddressTable;
// Handle to GLU32.dll
private long hglu32;
+ private boolean haveWGLARBPbuffer = true;
private static final int MAX_PFORMATS = 256;
private static final int MAX_ATTRIBS = 256;
@@ -150,6 +151,8 @@ public abstract class WindowsGLContext extends GLContext {
if (created) {
resetGLFunctionAvailability();
+ haveWGLARBPbuffer = (isExtensionAvailable("WGL_ARB_pbuffer") &&
+ isExtensionAvailable("WGL_ARB_pixel_format"));
// Windows can set up sharing of display lists after creation time
WindowsGLContext other = (WindowsGLContext) GLContextShareSet.getShareContext(this);
if (other != null) {
@@ -681,4 +684,8 @@ public abstract class WindowsGLContext extends GLContext {
protected static String hdcToString(long hdc) {
return "0x" + Long.toHexString(hdc);
}
+
+ protected boolean haveWGLARBPbuffer() {
+ return haveWGLARBPbuffer;
+ }
}
diff --git a/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java
index 1838f62aa..de13be0a1 100644
--- a/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java
+++ b/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java
@@ -102,7 +102,7 @@ public class WindowsOnscreenGLContext extends WindowsGLContext {
}
public boolean canCreatePbufferContext() {
- return true;
+ return haveWGLARBPbuffer();
}
public synchronized GLContext createPbufferContext(GLCapabilities capabilities,