diff options
author | Kenneth Russel <[email protected]> | 2009-01-06 08:13:09 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2009-01-06 08:13:09 +0000 |
commit | 2f986f2052144764d698da05a178d22c4754b563 (patch) | |
tree | fb3c8740a7896e93b8ea70be24caabd5ce9ce0b4 /src/classes/javax/media | |
parent | 3aee79d92e58f0ca82b737b0099bbc52abded952 (diff) |
Added GLCapabilities.setBackgroundOpaque() and isBackgroundOpaque()
for shaped window support on Mac OS X, and modified MacOSXCGLContext
to pay attention to this bit. Changed Mac OS X port of Newt to make
window non-opaque if borderless, and still allow it to receive the
keyboard focus.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1841 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media')
-rw-r--r-- | src/classes/javax/media/opengl/GLCapabilities.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/classes/javax/media/opengl/GLCapabilities.java b/src/classes/javax/media/opengl/GLCapabilities.java index 0a36fe502..8f89f605c 100644 --- a/src/classes/javax/media/opengl/GLCapabilities.java +++ b/src/classes/javax/media/opengl/GLCapabilities.java @@ -65,6 +65,10 @@ public class GLCapabilities implements Cloneable { private boolean sampleBuffers = false; private int numSamples = 2; + // Support for transparent windows containing OpenGL content + // (currently only has an effect on Mac OS X) + private boolean backgroundOpaque = true; + // Bits for pbuffer creation private boolean pbufferFloatingPointBuffers; private boolean pbufferRenderToTexture; @@ -316,6 +320,29 @@ public class GLCapabilities implements Cloneable { return pbufferRenderToTextureRectangle; } + /** For on-screen OpenGL contexts on some platforms, sets whether + the background of the context should be considered opaque. On + supported platforms, setting this to false, in conjunction with + other changes at the window toolkit level, can allow + hardware-accelerated OpenGL content inside of windows of + arbitrary shape. To achieve this effect it is necessary to use + an OpenGL clear color with an alpha less than 1.0. The default + value for this flag is <code>true</code>; setting it to false + may incur a certain performance penalty, so it is not + recommended to arbitrarily set it to false. */ + public void setBackgroundOpaque(boolean opaque) { + backgroundOpaque = opaque; + } + + /** Indicates whether the background of this OpenGL context should + be considered opaque. Defaults to true. + + @see #setBackgroundOpaque + */ + public boolean isBackgroundOpaque() { + return backgroundOpaque; + } + /** Returns a textual representation of this GLCapabilities object. */ public String toString() { @@ -335,6 +362,7 @@ public class GLCapabilities implements Cloneable { ", Alpha Accum: " + accumAlphaBits + ", Multisample: " + sampleBuffers + (sampleBuffers ? ", Num samples: " + numSamples : "") + + ", Opaque: " + backgroundOpaque + " ]"); } } |