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

Image widget/dynamic image loading #29

Open
woelper opened this issue Dec 4, 2020 · 2 comments
Open

Image widget/dynamic image loading #29

woelper opened this issue Dec 4, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@woelper
Copy link

woelper commented Dec 4, 2020

First of all, thanks for this amazing project!
This is probably more a question, but I was wondering if there is an option to create an image widget directly or draw into an image resource?
My use case would be to download images dynamically and insert them into the UI or render a 3d object into a texture inside the UI.
I've seen the latest release notes from 0.5.0 and was excited about Thyme images can be defined without requiring an actual image on disk - but I could not find out how this can actually be done. Thanks in advance!

@Grokmoo Grokmoo added the enhancement New feature or request label Dec 5, 2020
@Grokmoo
Copy link
Owner

Grokmoo commented Dec 5, 2020

Thyme doesn't quite do what you are after yet.

I think it is pretty close to the first part - download images dynamically and insert them into the UI. Right now, image data can only be specified in the ContextBuilder (so, before the app is created). This needs to be switched around so that image data can be specified at any time, just like is already possible with the theme files. Then live reload / asset rebuild just needs to account for this. This is definitely on my near-term to-do list.

Render to texture support is something that would need to be handled in the GliumRenderer and WgpuRenderer. Methods would need to be exposed to allow you to get a backend-specific handle to a particular texture which could then be used for a draw command. This doesn't sound to me like it would be difficult to accomplish. Potentially limiting in this approach is that the texture in question would probably need to be fixed in size. We probably would want a register_texture_empty method on the Context / ContextBuilder to give you a starting point.

Jared

@woelper
Copy link
Author

woelper commented Dec 5, 2020

Thanks for the reply Jared!

Both ideas sound absolutely great, especially the exposed texture to draw into - that sounds extremely flexible!

If I can somehow help, please let me know. Again, thanks for looking into this!

Johann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants