aboutsummaryrefslogtreecommitdiffstatsci
path: root/testDrm/src/Egl/Surface.cs
diff options
context:
space:
mode:
Diffstat (limited to 'testDrm/src/Egl/Surface.cs')
-rw-r--r--testDrm/src/Egl/Surface.cs25
1 files changed, 16 insertions, 9 deletions
diff --git a/testDrm/src/Egl/Surface.cs b/testDrm/src/Egl/Surface.cs
index ccfcaa9c..5a441a56 100644
--- a/testDrm/src/Egl/Surface.cs
+++ b/testDrm/src/Egl/Surface.cs
@@ -41,23 +41,26 @@ namespace EGL
{
#region pinvoke
[DllImportAttribute("libEGL.dll")]
- public static extern EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, IntPtr attrib_list);
+ internal static extern EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, IntPtr attrib_list);
[DllImportAttribute("libEGL.dll")]
- public static extern EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, int[] attrib_list);
+ internal static extern EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, int[] attrib_list);
[DllImportAttribute("libEGL.dll")]
- public static extern EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, int[] attrib_list);
+ internal static extern EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, int[] attrib_list);
[DllImportAttribute("libEGL.dll")][return: MarshalAsAttribute(UnmanagedType.I1)]
- public static extern bool eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
+ internal static extern bool eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
[DllImportAttribute("libEGL.dll")][return: MarshalAsAttribute(UnmanagedType.I1)]
- public static extern bool eglQuerySurface(EGLDisplay dpy, EGLSurface surface, int attribute, out int value);
+ internal static extern bool eglQuerySurface(EGLDisplay dpy, EGLSurface surface, int attribute, out int value);
[DllImportAttribute("libEGL.dll")]
- public static extern EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, int buftype, EGLClientBuffer buffer, EGLConfig config, int[] attrib_list);
+ internal static extern EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, int buftype, EGLClientBuffer buffer, EGLConfig config, int[] attrib_list);
[DllImportAttribute("libEGL.dll")][return: MarshalAsAttribute(UnmanagedType.I1)]
- public static extern bool eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, int attribute, int value);
+ internal static extern bool eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, int attribute, int value);
[DllImportAttribute("libEGL.dll")][return: MarshalAsAttribute(UnmanagedType.I1)]
- public static extern bool eglBindTexImage(EGLDisplay dpy, EGLSurface surface, int buffer);
+ internal static extern bool eglBindTexImage(EGLDisplay dpy, EGLSurface surface, int buffer);
[DllImportAttribute("libEGL.dll")][return: MarshalAsAttribute(UnmanagedType.I1)]
- public static extern bool eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, int buffer);
+ internal static extern bool eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, int buffer);
+ [DllImportAttribute("libEGL.dll")][return: MarshalAsAttribute(UnmanagedType.I1)]
+ internal static extern bool eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
+
#endregion
Context ctx;
@@ -75,6 +78,10 @@ namespace EGL
if (!Context.MakeCurrent(ctx.dpy, handle, handle, ctx.ctx))
throw new NotSupportedException(string.Format("eglMakeCurrent on surface Failed: {0}",Context.GetError()));
}
+ public void SwapBuffers () {
+ if (!eglSwapBuffers (ctx.dpy, handle))
+ throw new NotSupportedException(string.Format("eglSwapBuffers Failed: {0}",Context.GetError()));
+ }
#region IDisposable implementation
~Surface(){