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

Texture from external sources #86

Closed
lostmsu opened this issue Jul 10, 2020 · 5 comments
Closed

Texture from external sources #86

lostmsu opened this issue Jul 10, 2020 · 5 comments
Labels
feature Related to new feature work

Comments

@lostmsu
Copy link

lostmsu commented Jul 10, 2020

It would be nice to be able to mirror contents of a shared DXGI surface (such as ones provided by new screen capture APIs) into a render target-like texture.

Normally engines do it by exposing native pointer to the texture resource (and potentially a device too), so that users could call SharpDX or some other DX binding to do the copying manually.

@maluoi
Copy link
Collaborator

maluoi commented Jul 10, 2020

I do actually have a little bit of code for this on the native side of the library! At one point I implemented screen->texture for some experimentation with different styles of curving screens. They haven't made it up to C# yet and may be a bit limited in functionality, but this sounds like a great idea to work on a bit more!

My previous experiments were using a pretty old C API, so I'm curious if you have a link to a newer one, or a C# one I could use for reference?

I'm gonna stick this link in here for reference. If this is in the wrong direction, let me know!
https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/desktop-dup-api

@maluoi maluoi added the feature Related to new feature work label Jul 10, 2020
@lostmsu
Copy link
Author

lostmsu commented Jul 10, 2020

@maluoi
Copy link
Collaborator

maluoi commented Jul 10, 2020

Awesome, thanks! I'll definitely ref this when testing :)

@maluoi maluoi changed the title Texture from shared DXGI surface Texture from external sources Jan 15, 2022
@maluoi
Copy link
Collaborator

maluoi commented Jan 17, 2022

Reference from how Stardust is currently doing this:
https://github.com/StardustXR/stardust-xr/blob/dev/src/integrations/wayland/surface.cpp

@maluoi
Copy link
Collaborator

maluoi commented Jun 3, 2022

This is now live on NuGet in v0.3.6-preview.7! See Tex.SetNativeSurface as well as some of the new desktop duplication demos.

@maluoi maluoi closed this as completed Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Related to new feature work
Projects
None yet
Development

No branches or pull requests

2 participants