Code Monkey home page Code Monkey logo

Comments (2)

grokys avatar grokys commented on May 22, 2024

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:

  • The main interface is IPlatformRenderInterface which is implemented by Direct2D1Platform and CairoPlatform.
  • You need to implement an IRenderer to actually carry out the drawing. The Direct2D and Cairo versions of this are actually sufficiently similar that a common base-class should probably factored out.
  • You then need to implement the platform-specific impls of the various media classes such as DrawingContent, FormattedText, Geometries etc.

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

from avalonia.

amerkoleci avatar amerkoleci commented on May 22, 2024

This is related to #6

from avalonia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.