Skip to content

OpenGL backend does not support images #846

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

Closed
MCOfficer opened this issue Apr 26, 2021 · 5 comments
Closed

OpenGL backend does not support images #846

MCOfficer opened this issue Apr 26, 2021 · 5 comments
Labels
duplicate This issue or pull request already exists feature New feature or request image rendering

Comments

@MCOfficer
Copy link

As per #354:

The OpenGL renderer still does not support the Image and Svg widgets, but I believe we can tackle that in another PR.

Also in that PR's discussion:

Are there any estimates on how hard it is to implement image support for OpenGL renderer ?

hecrj on 8 Jul 2020:

It shouldn't be hard to get a similar implementation to the iced_wgpu one.
However, we should try to abstract and move the atlas logic to iced_graphics instead of duplicating code. Additionally, it would be great to set the foundations for asynchronous loading of images at the same time. This is the hard part.

It's not ideal that I'm creating this tracking issue, but imo it's better than not having a tracking issue at all.

@hecrj hecrj added the feature New feature or request label May 4, 2021
@JoshStrobl
Copy link

Just chiming in here. I wanted to evaluate iced as an alternative to GTK4 when porting over my GTK4+C Linux audio manager to Rust. This backend makes heavy use of iconography for "normal" UX elements, for example various buttons for playback. The lack of support for images on the OpenGL backend is of considerable impact, as unfortunately I can't rely on the end user having hardware supported by wgpu. I fully understand that iced is experimental and not remotely comparable to something like GTK4 at this time, however my hope is that this will be treated with some priority for resolution before the grand 1.0 release.

@MCOfficer
Copy link
Author

MCOfficer commented Aug 12, 2021

Just in case this helps you or anyone else: If you don't load images dynamically, i.e. they are known to you at compile/development time, you might be able to work around it using vector graphics. Specifically, one of my projects uses font characters for iconography, which works perfectly and is more painless once you want to change their scale. You can also use the Svg widget for the same purpose.

Edit: See the svg example for Svgs, and todos for font icons.

Edit 2: removed the references to Svg, read on for the reason.

@JoshStrobl
Copy link

@MCOfficer So Svg works? Per your OP it mentions:

The OpenGL renderer still does not support the[...] Svg widgets

Has this changed since April 26th?

@MCOfficer
Copy link
Author

MCOfficer commented Aug 12, 2021

@MCOfficer So Svg works? Per your OP it mentions:

The OpenGL renderer still does not support the[...] Svg widgets

Has this changed since April 26th?

Ah damn, i might have told a lie there.

I just quickly grepped the source and found this line in the glow backend, which I assumed was Svg support:

https://github.com/hecrj/iced/blob/a2b1ba522a8b90a2e539fff5936c798efc3f3807/glow/src/backend.rs#L224

But as it turns out, that line was last changed by the PR my OP refers to, so if hecrj says in this PR that Svg isn't supported, I gotta trust that. Sorry for causing confusion.

@hecrj
Copy link
Member

hecrj commented Jan 20, 2022

Closing this in favor of #674.

@hecrj hecrj closed this as completed Jan 20, 2022
@hecrj hecrj added duplicate This issue or pull request already exists image rendering labels Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists feature New feature or request image rendering
Projects
None yet
Development

No branches or pull requests

3 participants