aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-09-08 19:45:11 +0200
committerSven Gothel <[email protected]>2012-09-08 19:45:11 +0200
commit9036376b7806a5fc61590bf49404eb71830de92f (patch)
treee12bd10755b88b8fb5318268c1243da0b5467157 /src/nativewindow
parentd22ac65d0f841e4c3698ec817d4ebbfdb7ee25a0 (diff)
Fix window mode attribute bit FBO_BIT usage in platform dependent code (map it to native type) ; OSX Caps selection ; WGL/GDI BITMAP fix
Fix window mode attribute bit FBO_BIT usage in platform dependent code (map it to native type) All platform dependent winAttrBit mapping: 'nativeType -> winAttrBit' and 'GLCapabilities -> winAttrBits' shall replace FBO_BIT w/ the native type of the wrapper surface, i.e. WINDOW_BIT (X11, WGL, CGL) or PBUFFER_BIT (EGL). This condenses to changes in - EGLGraphicsConfiguration: EGLConfigDrawableTypeBits / GLCapabilities2AttribList - X11GLXGraphicsConfiguration: FBCfgDrawableTypeBits, XVisualInfo2GLCapabilities / GLCapabilities2AttribList - WindowsWGLGraphicsConfiguration: AttribList2DrawableTypeBits, PFD2DrawableTypeBits / GLCapabilities2AttribList - OSX CGL/NS requires changes in MacOSXCGLContext, i.e. fix the surface mode of NSPixelFormat2GLCapabilities, CGLPixelFormat2GLCapabilities results. This change is included in the upcoming commit (class is heavily edited). OSX chooseGraphicsConfigurationStatic: Add missing 'GLGraphicsConfigurationUtil.fixGLCapabilities(..)' call - all platform impl. require to fix the given user caps due to the new offscreen auto selection mode WindowsWGLGraphicsConfiguration*: ARB / GDI updateGraphicsConfiguration*() - ARB method detects early whether it's suitable for given HDC, i.e. in case of BITMAP (it's not here) - GDI methods detect failure while choosing PFD and doesn't care of DOUBLEBUFFER in case of bitmap (fixes BITMAP usage) Capabilities/GLCapabilities: - Fix missing double-buffer check in GLCapabilities.equals() - add 'copyFrom(..)' method copy all data from give caps
Diffstat (limited to 'src/nativewindow')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/Capabilities.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
index 50e6ed46c..5795e8cfe 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
@@ -74,7 +74,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
public Object cloneMutable() {
return clone();
}
-
+
@Override
public Object clone() {
try {
@@ -84,6 +84,26 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
}
}
+ /**
+ * Copies all {@link Capabilities} values
+ * from <code>source</code> into this instance.
+ * @return this instance
+ */
+ public Capabilities copyFrom(CapabilitiesImmutable other) {
+ redBits = other.getRedBits();
+ greenBits = other.getGreenBits();
+ blueBits = other.getBlueBits();
+ alphaBits = other.getAlphaBits();
+ backgroundOpaque = other.isBackgroundOpaque();
+ onscreen = other.isOnscreen();
+ isBitmap = other.isBitmap();
+ transparentValueRed = other.getTransparentRedValue();
+ transparentValueGreen = other.getTransparentGreenValue();
+ transparentValueBlue = other.getTransparentBlueValue();
+ transparentValueAlpha = other.getTransparentAlphaValue();
+ return this;
+ }
+
@Override
public int hashCode() {
// 31 * x == (x << 5) - x