示例#1
0
        public static nint GetConfig(EGLDisplay display, int[] desiredConfig)
        {
            int num_configs;
            var configs = new nint[1];

            if (!Egl.eglChooseConfig(display, desiredConfig, configs, 1, out num_configs) || num_configs < 1)
            {
                throw new NotSupportedException(String.Format("[EGL] Failed to retrieve GraphicsMode, error {0}", Egl.eglGetError()));
            }
            return(configs[0]);
        }
示例#2
0
        public static nint[] GetAllConfigs(EGLDisplay display, int[] desiredConfig)
        {
            int num_configs;

            if (!Egl.eglChooseConfig(display, desiredConfig, null, 0, out num_configs) || num_configs == 0)
            {
                throw new NotSupportedException(String.Format("[EGL] Failed to retrieve GraphicsMode, error {0}", Egl.eglGetError()));
            }

            var configs = new nint[num_configs];

            if (!Egl.eglChooseConfig(display, null, configs, num_configs, out num_configs))
            {
                throw new NotSupportedException(String.Format("[EGL] Failed to retrieve GraphicsMode, error {0}", Egl.eglGetError()));
            }
            return(configs);
        }