Comments (11)
This should be pretty straightforward as Perspex uses DirectX11 (DIrect2D) for its drawing already and currently also draws on the UI thread.
One way to do this would be to add a hook added to the Perspex.Direct2D1.Renderer class which would pass the SharpDX.Direct2D1.RenderTarget. In this way DirectX would be able to draw where it wanted.
Another way would be to add something like a D3DImage class to Perspex.Direct2D1 which draws to an intermediate render target, and the is composited by Perspex.Direct2D1.Renderer.
If you would like to have a go, feel free to fork and play! Otherwise I will look into adding something like this soon.
from avalonia.
Yes thanks, i would use perspex for cross platform editor ui for my game engine and this is quite important, thanks again
from avalonia.
Note that would be good to have the possibility to embed OpenGL rendering even on Windows, so user can render OpenGL on Direct2D.
Probably this can be handled with WIN32 child window embedding.
from avalonia.
One thought: if you're using it for a game engine, wouldn't it be more useful if Perspex could draw into your DirectX render target?
from avalonia.
Yes, I can try to achieve some stuff and maybe report back.
from avalonia.
I've looked into this a little, but I could use some input on how you would like it to be used.
- Would you prefer embedding of DirectX or Perspex to be embedded?
- If embedding of DirectX, would you prefer having access to the render target or drawing to your own render target and having that composited onto the Perspex output.
- How would you like to interact with the Perspex message loop?
from avalonia.
This is something I experiment with, probably need to think almost all ways, you can add D3DImage like where the
use can have DirectX11 or OpenGL and then draw the target bitmap using Direct2D.
But would be also good to have OpenGL like embedding (this means WIN32 child window) and do composition over Direct2D.
Under GTK only OpenGL can be done (there is something similar here, https://github.com/bchavez/SharpFlame).
Anyway wouldn't be better to go with GTK 3 instead of GTK 2, MonoDevelop started migration to GTK 3.
What do you think?
from avalonia.
Re: GTK3 - please start a new issue!
from avalonia.
This is completely the wrong place for this (although there is some loose connection to D3D), but just wanted to say, Perspex looks awesome! I've been wondering if I'll ever be able to make my Gemini framework cross-platform, and this is probably the most promising potential solution I've seen. I will be watching your progress with interest.
from avalonia.
Thanks Tim, yes completely the wrong place, but please come join us in our gitter room! https://gitter.im/grokys/Perspex
from avalonia.
opengl and native program embedding is now merged.
from avalonia.
Related Issues (20)
- The modal dialog flashes on macOS when clicking on the parent window HOT 2
- Avalonia menu export DBus interop crashes plasma 5.27 HOT 1
- OptionalFeatureProvider in Linux Framebuffer platform HOT 4
- The TextBox input using the PasswordChar property has incorrect behavior on Android HOT 9
- Cannot add datagrid control HOT 22
- Textblock shows nothing with timespan string format HOT 1
- Update Popup.OverlayDismissEventPassThrough default based on form factor
- ILauncher launch events and intercept
- [Linux] Better integration with the desktop environment HOT 1
- 11.1.0 regression: FontFamily="Monospace" doesn't do anything
- The INotifyDataErrorInfo validates the data and vertically arranges the prompt content on the interface. HOT 5
- Consider reviewing IAvaloniaList.TrackItemPropertyChanged-extension
- Custom font family is not working in WebAssembly HOT 2
- Converters for resources HOT 2
- MenuFlyout ItemsSource item binding command always disabled
- AVLN3000: Can't use resource for Foreground property of TextPresenter HOT 1
- Arabic diacritics rendered incorrectly
- Visibility of Text selection handles on empty TextBoxes on Android
- Soft Keyboard Reappearance Issue for an already focused TextBox HOT 1
- PointerMovedEvent and PointerReleasedEvent do not trigger after mouse leaves the title bar with pressed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avalonia.