Help with SkiaSharp rendering in an AvaloniaUI control

This page summarizes the projects mentioned and recommended in the original post on /r/csharp

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Avalonia

    Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET Foundation community project.

  • I want to do some SkiaSharp rendering in an AvalonaiUI control. I found this StackOverflow answer that suggested using OpenGlControlBase, with an example, of how to do OpenGL rendering in a control. Then I found this StackOverflow answer, with an example, of how to do SkiaSharp rendering with an already existing OpenGL context, although comming from Silk.NET. I thought I'd just combine the two and be done with it, here's my attempt, but of course it wasn't that easy.

  • Silk.NET

    The high-speed OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, WebGPU, and DirectX bindings library your mother warned you about.

  • I want to do some SkiaSharp rendering in an AvalonaiUI control. I found this StackOverflow answer that suggested using OpenGlControlBase, with an example, of how to do OpenGL rendering in a control. Then I found this StackOverflow answer, with an example, of how to do SkiaSharp rendering with an already existing OpenGL context, although comming from Silk.NET. I thought I'd just combine the two and be done with it, here's my attempt, but of course it wasn't that easy.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • avaloniaui-test

  • I want to do some SkiaSharp rendering in an AvalonaiUI control. I found this StackOverflow answer that suggested using OpenGlControlBase, with an example, of how to do OpenGL rendering in a control. Then I found this StackOverflow answer, with an example, of how to do SkiaSharp rendering with an already existing OpenGL context, although comming from Silk.NET. I thought I'd just combine the two and be done with it, here's my attempt, but of course it wasn't that easy.

  • apitrace

    Tools for tracing OpenGL, Direct3D, and other graphics APIs

  • I don't see anything wrong with your code, altough I'm not familiar with Avalonia or Silk. I suggest you try to use apitrace for (a probably long and painful day) debugging it.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts