Exemplo n.º 1
0
        public GraphicsDescriptor[] SetupDecoration(IList <GraphicsDescriptor> data, byte[] bytes)
        {
            var res = new GraphicsDescriptor[bytes.Length];

            for (int i = 0; i < bytes.Length; i++)
            {
                res[i] = data[bytes[i]];
            }

            return(res);
        }
Exemplo n.º 2
0
        private static BackendRenderer CreateRenderer(
            GraphicsBackend backend,
            ref GraphicsDescriptor descriptor,
            IntPtr windowHandle)
        {
            // ReSharper disable once ConvertSwitchStatementToSwitchExpression
            switch (backend)
            {
            case GraphicsBackend.OpenGL:
                return(new RendererOpenGL(windowHandle));

            case GraphicsBackend.Metal:
                return(new RendererMetal(ref descriptor, windowHandle));

            case GraphicsBackend.Direct3D11:
            case GraphicsBackend.OpenGLES2:
            case GraphicsBackend.OpenGLES3:
            case GraphicsBackend.Dummy:
                throw new NotImplementedException();

            default:
                throw new ArgumentOutOfRangeException(nameof(backend), backend, null);
            }
        }