aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-03-05 04:34:41 +0100
committerSven Gothel <[email protected]>2012-03-05 04:34:41 +0100
commit90c46b1ef1f199ceb63e85c85e9ebeb919d49c4a (patch)
treeded4b93e80eb39ff33c80638c10a531222c105a3 /src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
parent875042340b68137b584907c539b7b7ecc5c5b15c (diff)
Complete LOCK_SURFACE_CHANGED ; Introduce NativeVisualID (Daisy chaining *GraphicsConfiguration) ; ...
NativeVisualID: New interface for Capabilities implementations, allowing retrieval of the native 'visual id'. Impl. by WGL, X11 and EGL. JAWTWindow.lockSurface() - Detect surfaceHandle change an return LOCK_SURFACE_CHANGED (see: LOCK_SURFACE_CHANGED) EGLDrawable: - Impl. updateHandle() (see: LOCK_SURFACE_CHANGED) - use NativeVisualID for EGLGraphicsConfiguration selection to respect a native 'visual id' EGLContext.createContextImpl: Use NIO for attributes EGLDisplayUtil: Enhance eglGetDisplay w/ DEBUG code and NativeSurface / EGL_DEFAULT_DISPLAY variation EGL, XGL, WGL GraphicsConfiguration: - Don't set ALPHA_SIZE and STENCIL_SIZE if not requested in attribute list for context creation. - toString() shows proper identification, eg.: egl, x11, win32 .. EGLGraphicsConfigurationFactory: Daisy chain GraphicsConfigurationFactory for native device type (currently only X11). This allows choosing the EGLGraphicsConfiguration and hence native visual id based on EGL when invoked via the factory model (generic). In case EGLGraphicsConfigurationFactory is not suitable or doesn't produce a native visual id, it falls back the the original one. X11AWTGraphicsConfigurationFactory and X11Window: Use generic NativeVisualID which allows EGLGraphicsConfiguration implicit. *GraphicsConfiguration's DEBUG flag is pushed up to DefaultGraphicsConfiguration LOCK_SURFACE_CHANGED: - commit 006e9fe402a0a47b45fd2c4af51296aef895e8b5 - commit a0177c8a1048683e5d43f4712f8f9e37091d4e85 Impact: - Fixes EGL/GLES (wrapper/native) usage on X11, proper Xvisual selection w/ EGL - Fixes EGL/GLES (wrapper/native) usage on Windows, ANGLE works w/ NEWT and forced ES2
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
index bd5eb1b99..cc7d267b0 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
@@ -33,7 +33,9 @@ import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
-public class EGLGLCapabilities extends GLCapabilities {
+import jogamp.nativewindow.NativeVisualID;
+
+public class EGLGLCapabilities extends GLCapabilities implements NativeVisualID {
final long eglcfg;
final int eglcfgid;
final int renderableType;
@@ -74,6 +76,7 @@ public class EGLGLCapabilities extends GLCapabilities {
" with EGL-RenderableType["+renderableTypeToString(null, renderableType)+"]");
}
this.renderableType = renderableType;
+ this.nativeVisualID = -1;
}
public Object cloneMutable() {
@@ -94,6 +97,21 @@ public class EGLGLCapabilities extends GLCapabilities {
final public void setNativeVisualID(int vid) { nativeVisualID=vid; }
final public int getNativeVisualID() { return nativeVisualID; }
+ final public int getVisualID(NVIDType type) {
+ switch(type) {
+ case GEN_ID:
+ // fall through intended
+ case EGL_ConfigID:
+ return getEGLConfigID();
+ case NATIVE_ID:
+ // fall through intended
+ case EGL_NativeVisualID:
+ return getNativeVisualID();
+ default:
+ throw new IllegalArgumentException("Invalid type <"+type+">");
+ }
+ }
+
public static boolean isCompatible(GLProfile glp, int renderableType) {
if(null == glp) {
return true;
@@ -147,8 +165,8 @@ public class EGLGLCapabilities extends GLCapabilities {
if(null == sink) {
sink = new StringBuffer();
}
- sink.append("0x").append(Long.toHexString(eglcfgid)).append(": ");
- sink.append("vid 0x").append(Integer.toHexString(nativeVisualID)).append(", ");
+ sink.append("egl cfg 0x").append(Integer.toHexString(eglcfgid));
+ sink.append(", vid 0x").append(Integer.toHexString(nativeVisualID)).append(": ");
super.toString(sink);
sink.append(", [");
renderableTypeToString(sink, renderableType);