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

Support custom window icon #44

Closed
dhardy opened this issue Jan 29, 2020 · 3 comments · Fixed by #228
Closed

Support custom window icon #44

dhardy opened this issue Jan 29, 2020 · 3 comments · Fixed by #228
Labels
low priority Not a near-term goal / not easily achievable

Comments

@dhardy
Copy link
Collaborator

dhardy commented Jan 29, 2020

API: https://docs.rs/winit/0.20.0/winit/window/struct.Icon.html

@dhardy dhardy added the low priority Not a near-term goal / not easily achievable label Jan 29, 2020
@dhardy
Copy link
Collaborator Author

dhardy commented Jan 29, 2020

Probably the best approach is to add a method providing the icon data to the kas::Window trait, then use that within kas_wgpu when opening the window.

@dhardy
Copy link
Collaborator Author

dhardy commented Aug 2, 2021

We now have image_from_path(path) -> Result<ImageId, ..>. This is used for drawing images via the shell, thus uploads the decoded image to GPU memory and does not make it available through the API.

We should allow re-use of the image loading code in the form of a resource manager, updating the image code to use that:

// with singleton instances for T == Image, ...
ResourceManager<T> {
    // deduplicate path(?) and load:
    fn load(&mut self, path: PathBuf) -> Result<ResId, Error>;
    fn free(...);
    fn get(&self, id: ResId) -> Option<&T>;
}

@dhardy dhardy changed the title Support custom window icon Resource manager, custom window icon Aug 2, 2021
@dhardy dhardy changed the title Resource manager, custom window icon Support custom window icon Aug 2, 2021
@dhardy
Copy link
Collaborator Author

dhardy commented Aug 2, 2021

In this instance it isn't worth worrying about deduplication, though I did add a TODO(opt) comment to #228.

@dhardy dhardy closed this as completed Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority Not a near-term goal / not easily achievable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant