private QueryString ( EGLDisplay dpy, int name ) : IntPtr | ||
dpy | EGLDisplay | |
name | int | |
return | IntPtr |
public void CreateWindowSurface(IntPtr config) { //some gles2 implementation may supports more eglSurfaceConfig //we if (eglSurfaceConfigs == null) { IntPtr vendor = Egl.QueryString(display, Egl.EXTENSIONS); string eglVendor = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(vendor); if (eglVendor.Contains("EGL_NV_post_sub_buffer")) { //we want some extensions ... eglSurfaceConfigs = new int[] { //key, value AngleProjectEglConfig.EGL_POST_SUB_BUFFER_SUPPORTED_NV, 1, Egl.NONE//end config array with zero }; } else { //blank config eglSurfaceConfigs = new int[] { //key, value Egl.NONE//end config array with zero }; } } Surface = Egl.CreateWindowSurface(Display, config, Handle, eglSurfaceConfigs); int error = Egl.GetError(); if (error != Egl.SUCCESS) { throw new GraphicsContextException(String.Format("[Error] Failed to create EGL window surface, error {0}.", error)); } }