OpenTK.Platform.Egl.Egl.CreateWindowSurface C# (CSharp) Метод

CreateWindowSurface() приватный Метод

private CreateWindowSurface ( EGLDisplay dpy, EGLConfig config, IntPtr win, int attrib_list ) : EGLSurface
dpy EGLDisplay
config EGLConfig
win IntPtr
attrib_list int
Результат EGLSurface
        public static extern EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, int[] attrib_list);
        [DllImportAttribute("libEGL.dll", EntryPoint = "eglCreatePbufferSurface")]

Usage Example

Пример #1
0
        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));
            }
        }
All Usage Examples Of OpenTK.Platform.Egl.Egl::CreateWindowSurface