Ejemplo n.º 1
0
            /// <summary>
            /// Create the native surface handle.
            /// </summary>
            /// <param name="configId">
            /// A <see cref="IntPtr"/> that specifies the configuration ID.
            /// </param>
            /// <param name="attribs">
            /// A <see cref="T:int[]"/> that lists the handle attributes.
            /// </param>
            /// <exception cref="InvalidOperationException">
            /// Exception thrown if the handle is already created.
            /// </exception>
            public override void CreateHandle(IntPtr configId, int[] attribs)
            {
                if (_Handle != IntPtr.Zero)
                {
                    throw new InvalidOperationException("handle already created");
                }

                if ((_Handle = Egl.CreatePbufferSurface(_Display, configId, attribs)) == IntPtr.Zero)
                {
                    throw new InvalidOperationException("unable to create window surface");
                }
            }