public static GRContext Create(GRBackend backend, IntPtr backendContext) { switch (backend) { case GRBackend.Metal: throw new NotSupportedException(); case GRBackend.OpenGL: return(GetObject <GRContext> (SkiaApi.gr_context_make_gl(backendContext))); case GRBackend.Vulkan: throw new NotSupportedException(); default: throw new ArgumentOutOfRangeException(nameof(backend)); } }
public static GRContext CreateGl(GRGlInterface backendContext) { return(GetObject <GRContext> (SkiaApi.gr_context_make_gl(backendContext == null ? IntPtr.Zero : backendContext.Handle))); }