AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.72k stars 2.22k forks source link

Rendering system #18

Closed KeKl closed 8 years ago

KeKl commented 9 years ago

Would it be possible to use also OpenGL as a rendering subsystem?

Which requirements are necessary for the rendering subsystem?

grokys commented 9 years ago

Short answer: Yes, Cairo supports OpenGL as a backend.

Long answer: A rendering subsystem which uses OpenGL directly could be written but you'd essentially have to rewrite a 2D drawing library like Direct2D or Cairo over the top of it, which is something that I don't think many people would want to do.

As for your points, I'm not sure what you're asking in the first two.

For point 3 - There is no single base class, as there are many facets to the rendering subsystem. The easiest way to see what needs to be implemented currently is to look at the code:

https://github.com/grokys/Perspex/tree/master/Windows/Perspex.Direct2D1 https://github.com/grokys/Perspex/tree/master/Cairo/Perspex.Cairo

But in short:

This can probably be tidied up to some extent and certainly needs to be documented better.

amerkoleci commented 9 years ago

This is related to #6