diff options
author | Sven Gothel <[email protected]> | 2012-06-27 06:16:09 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-06-27 06:16:09 +0200 |
commit | 914b522af26b6d779dc931bf4303be3c7e898eff (patch) | |
tree | 4d25ffbfd0f7dae3fec829dba9f9d2ecd8c146ba /src/jogl/classes/jogamp/opengl | |
parent | 4e2fb5389d22f2b16c1678843d4e31dd948c7902 (diff) |
Capabilities cleanup: make most get*() final, impl. Comparable to CapabilitiesImmutable, Misc ..
- Comparable<CapabilitiesImmutable> to CapabilitiesImmutable:
"interface CapabilitiesImmutable extends VisualIDHolder, WriteCloneable" ->
"interface CapabilitiesImmutable extends VisualIDHolder, WriteCloneable, Comparable<CapabilitiesImmutable>"
- CapabilitiesImmutable and GLCapabilitiesImmutable get-methods final (most)
- GLCapabilitiesImmutable.compareTo: add doubleBuffered (between stereo and samples)
Misc:
- Add @Override
- remove trailing whitespace,
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
3 files changed, 28 insertions, 19 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java index f813edf86..70a570174 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java @@ -37,17 +37,17 @@ import javax.media.opengl.GLProfile; public class EGLGLCapabilities extends GLCapabilities { private long eglcfg; final private int eglcfgid; - final private int renderableType; + final private int renderableType; final private int nativeVisualID; - + /** - * + * * @param eglcfg * @param eglcfgid * @param visualID native visualID if valid, otherwise VisualIDHolder.VID_UNDEFINED * @param glp desired GLProfile, or null if determined by renderableType * @param renderableType actual EGL renderableType - * + * * May throw GLException if given GLProfile is not compatible w/ renderableType */ public EGLGLCapabilities(long eglcfg, int eglcfgid, int visualID, GLProfile glp, int renderableType) { @@ -62,10 +62,12 @@ public class EGLGLCapabilities extends GLCapabilities { this.nativeVisualID = visualID; } + @Override public Object cloneMutable() { return clone(); } + @Override public Object clone() { try { return super.clone(); @@ -73,13 +75,13 @@ public class EGLGLCapabilities extends GLCapabilities { throw new GLException(e); } } - + final protected void setEGLConfig(long v) { eglcfg=v; } final public long getEGLConfig() { return eglcfg; } final public int getEGLConfigID() { return eglcfgid; } final public int getRenderableType() { return renderableType; } final public int getNativeVisualID() { return nativeVisualID; } - + @Override final public int getVisualID(VIDType type) throws NativeWindowException { switch(type) { @@ -90,9 +92,9 @@ public class EGLGLCapabilities extends GLCapabilities { return getNativeVisualID(); default: throw new NativeWindowException("Invalid type <"+type+">"); - } + } } - + public static boolean isCompatible(GLProfile glp, int renderableType) { if(null == glp) { return true; @@ -121,7 +123,7 @@ public class EGLGLCapabilities extends GLCapabilities { } return null; } - + public static StringBuilder renderableTypeToString(StringBuilder sink, int renderableType) { if(null == sink) { sink = new StringBuilder(); @@ -139,9 +141,10 @@ public class EGLGLCapabilities extends GLCapabilities { if(0 != (renderableType & EGL.EGL_OPENVG_API)) { if(!first) sink.append(", "); sink.append("VG"); first=false; } - return sink; + return sink; } - + + @Override public StringBuilder toString(StringBuilder sink) { if(null == sink) { sink = new StringBuilder(); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java index 5ff63d93b..e255a0672 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java @@ -119,7 +119,7 @@ public class WGLGLCapabilities extends GLCapabilities { if (iresults[i] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) { setPbufferFloatingPointBuffers(true); } - + // normal RGBA FB: WGLExt.WGL_TYPE_RGBA_ARB // ignore unknown results here break; @@ -177,10 +177,12 @@ public class WGLGLCapabilities extends GLCapabilities { return true; } + @Override public Object cloneMutable() { return clone(); } + @Override public Object clone() { try { return super.clone(); @@ -191,11 +193,11 @@ public class WGLGLCapabilities extends GLCapabilities { final public PIXELFORMATDESCRIPTOR getPFD() { return pfd; } final public int getPFDID() { return pfdID; } - + final public boolean isSetByARB() { return 0 < arb_pixelformat; } final public boolean isSetByGDI() { return 0 > arb_pixelformat; } final public boolean isSet() { return 0 != arb_pixelformat; } - + @Override final public int getVisualID(VIDType type) throws NativeWindowException { switch(type) { @@ -205,16 +207,17 @@ public class WGLGLCapabilities extends GLCapabilities { return getPFDID(); default: throw new NativeWindowException("Invalid type <"+type+">"); - } + } } - + + @Override public StringBuilder toString(StringBuilder sink) { if(null == sink) { sink = new StringBuilder(); } sink.append("wgl vid 0x").append(Integer.toHexString(pfdID)).append(" "); switch (arb_pixelformat) { - case -1: + case -1: sink.append("gdi"); break; case 0: diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java index 96d4c7713..e0b69ffd4 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java @@ -55,10 +55,12 @@ public class X11GLCapabilities extends GLCapabilities { this.fbcfgid = VisualIDHolder.VID_UNDEFINED; } + @Override public Object cloneMutable() { return clone(); } + @Override public Object clone() { try { return super.clone(); @@ -86,9 +88,10 @@ public class X11GLCapabilities extends GLCapabilities { return getFBConfigID(); default: throw new NativeWindowException("Invalid type <"+type+">"); - } + } } - + + @Override public StringBuilder toString(StringBuilder sink) { if(null == sink) { sink = new StringBuilder(); |