Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGLControlBase: allow changing the rendering order of the avalonia layer and the opengl layer #16976

Open
vpenades opened this issue Sep 10, 2024 · 0 comments

Comments

@vpenades
Copy link

vpenades commented Sep 10, 2024

Is your feature request related to a problem? Please describe.

OpenGLControlBase has two rendering stages executed in the following order:

  1. Avalonia's own Render method
  2. OnOpenGlRender

This is probably useful in some scenarios where you want to overlay openGL on top of avalonia controls.

The problem I have is that I am working on a CAD application where I need to render some 2D overlays and toolings on top of openGL, and it makes sense to do so using Avalonia instead of GL

But right now, to do so, I need to create an extra canvas control on top of the OpenGLControlBase, where I could simply use OpenGLControlBase itself, if the Avalonia's rendering happens after GL rendering.

Describe the solution you'd like

I would like to have a boolean property in OpenGLControlBase to indicate the Avalonia's and OpenGL rendering order, so when set, Avalonia's Render is drawn on top of OnOpenGlRender draw.

Describe alternatives you've considered

Right now I am creating an additional Canvas control on top of OpenGlControlBase

The drawback is, being two controls, the wiring is a lot more complex because what I am redering in both layers must match

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant