+
+ fun caveat: EGLConfigCaveat do
+ return new EGLConfigCaveat.from_i(display.config_attrib(config, "3027".to_hex))
+ end
+
+ fun conformant: EGLConformant do
+ return new EGLConformant.from_i(display.config_attrib(config, "3042".to_hex))
+ end
+end
+
+extern class EGLConfigCaveat `{ EGLint `}
+ new from_i(val: Int) `{ return (EGLint)val; `}
+ fun to_i: Int `{ return recv; `}
+
+ new none `{ return EGL_NONE; `}
+ fun is_none: Bool `{ return recv == EGL_NONE; `}
+
+ new dont_care `{ return EGL_DONT_CARE; `}
+ fun is_dont_care: Bool `{ return recv == EGL_DONT_CARE; `}
+
+ new slow `{ return EGL_SLOW_CONFIG; `}
+ fun is_slow: Bool `{ return recv == EGL_SLOW_CONFIG; `}
+
+ # Obselete since EGL 1.3, use EGL_CONFORMANT instead
+ new non_conformant `{ return EGL_NON_CONFORMANT_CONFIG; `}
+ fun is_non_conformant: Bool `{ return recv == EGL_NON_CONFORMANT_CONFIG; `}
+
+ redef fun to_s
+ do
+ if is_none then return "EGL_NONE"
+ if is_dont_care then return "EGL_DONT_CARE"
+ if is_slow then return "EGL_SLOW_CONFIG"
+ if is_non_conformant then return "EGL_NON_CONFORMANT"
+ return "Unknown or invalid value"
+ end
+end
+
+extern class EGLConformant `{ EGLint `}
+ new `{ return (EGLint)0; `}
+ new from_i(val: Int) `{ return (EGLint)val; `}
+ fun to_i: Int `{ return recv; `}
+
+ fun opengl: Bool `{ return recv & EGL_OPENGL_BIT; `}
+ fun with_opengl: EGLConformant `{ return recv | EGL_OPENGL_BIT; `}
+
+ fun opengl_es: Bool `{ return recv & EGL_OPENGL_ES_BIT; `}
+ fun with_opengl_es: EGLConformant `{ return recv | EGL_OPENGL_ES_BIT; `}
+
+ fun opengl_es2: Bool `{ return recv & EGL_OPENGL_ES2_BIT; `}
+ fun with_opengl_es2: EGLConformant `{ return recv | EGL_OPENGL_ES2_BIT; `}
+
+ fun openvg: Bool `{ return recv & EGL_OPENVG_BIT; `}
+ fun with_openvg: EGLConformant `{ return recv | EGL_OPENVG_BIT; `}
+
+ fun to_a: Array[String]
+ do
+ var features = new Array[String]
+ if opengl then features.add("OpenGL")
+ if opengl_es then features.add("OpenGL ES")
+ if opengl_es2 then features.add("OpenGL ES2")
+ if openvg then features.add("OpenVG")
+ return features
+ end
+
+ redef fun to_s do return to_a.join(", ")