src: move pseudo-toplevel methods from Object
[nit.git] / lib / egl.nit
index 781c2a4..d188c29 100644 (file)
@@ -14,8 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# EGL is an interface between the rendering APIs OpenGL, OpenGL ES, etc.
-# and the native windowing system.
+# Interface between rendering APIs (OpenGL, OpenGL ES, etc.) and the native windowing system.
 #
 # Most services of this module are a direct wrapper of the underlying
 # C library. If a method or class is not documented in Nit, refer to
@@ -104,6 +103,12 @@ extern class EGLDisplay `{ EGLDisplay `}
                }
        `}
 
+       private fun report_egl_error(cmsg: NativeString)
+       do
+               var msg = cmsg.to_s
+               print "libEGL error: {msg}"
+       end
+
        # Can be used directly, but it is preferable to use a `EGLConfigAttribs`
        fun config_attrib(config: EGLConfig, attribute: Int): Int `{
                EGLint val;
@@ -444,14 +449,9 @@ class EGLConfigChooser
        end
 end
 
-redef class Object
-       private fun report_egl_error(cmsg: NativeString)
-       do
-               var msg = cmsg.to_s
-               print "libEGL error: {msg}"
-       end
-end
-
 fun egl_bind_opengl_api: Bool `{ return eglBindAPI(EGL_OPENGL_API); `}
 fun egl_bind_opengl_es_api: Bool `{ return eglBindAPI(EGL_OPENGL_ES_API); `}
 fun egl_bind_openvg_api: Bool `{ return eglBindAPI(EGL_OPENVG_API); `}
+
+# Handle to the default display to use with EGL
+fun egl_default_display: Pointer `{ return EGL_DEFAULT_DISPLAY; `}