Skip to content

xtuzy/Veldrid.Maui.Controls

Repository files navigation

Veldrid.Maui.Controls

NuGet version(Yang.MAUICollectionView)

It is extracted from Veldrid.Samples,this project focuses on optimizing controls

How to use

Install Veldrid.Maui.Controls

Install Veldrid Packages

current official veldrid packages have some bugs on maui, for temparery fix they, i push some packages to nuget.org, you can install they to your app project to override offical dll.

In order to replace official veldrid, you need to add these to .csproj (ExcludeAssets will delete officail dll):

<ItemGroup>
    <PackageReference Include="Veldrid.SPIRV" Version="1.0.15" ExcludeAssets="All"/>
    <PackageReference Include="Veldrid.Maui.SPIRV" Version="1.0.16.1" />

    <PackageReference Include="Veldrid" Version="4.9.0" ExcludeAssets="All"/>
    <PackageReference Include="Yang.Veldrid.Maui.iOS" Version="4.9.10-ga1b22d70a3" />
</ItemGroup>

Create view

  • Add .UseVeldridView() to your app.

  • create view

     var veldridView = new VeldridView();
     veldridView.Backend = GraphicsBackend.OpenGLES;
     veldridView.AutoReDraw = true;// will loop render
     layout.Add(veldridView);
    
  • create drawable

see sample HelloTriangle, you need learn how to use veldrid, see https://veldrid.dev/

  • set drawable to veldridView

Advice GraphicsBackend

  • iOS - Metal (don't test)
  • Windows - D3D11
  • Android - OpenGLES

** Current veldrid don't have a nice memory manager for Vulkan backend, will waste many memeory, i don't advice you try it.