aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/javax/media
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow/classes/javax/media')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index b85ad47f2..6faa9890c 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -561,4 +561,21 @@ public abstract class NativeWindowFactory {
}
return null;
}
+
+ /**
+ * Returns true if the given visualID is valid for further processing, i.e. OpenGL usage,
+ * otherwise return false.
+ * <p>
+ * On certain platforms, i.e. X11, a valid visualID is required at window creation.
+ * Other platforms may determine it later on, e.g. OSX and Windows. </p>
+ * <p>
+ * If the visualID is {@link VisualIDHolder#VID_UNDEFINED} and the platform requires it
+ * at creation time (see above), it is not valid for further processing.
+ * </p>
+ */
+ public static boolean isNativeVisualIDValidForProcessing(int visualID) {
+ return NativeWindowFactory.TYPE_X11 != NativeWindowFactory.getNativeWindowType(false) ||
+ VisualIDHolder.VID_UNDEFINED != visualID ;
+ }
+
}