-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Managed texture loading #3297
Merged
Merged
Managed texture loading #3297
Changes from 20 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
f8cd5f4
add types from proposal
jprochazk aad9978
add load methods on `egui::Context`
jprochazk a94b17f
implement loaders from proposal in `egui_extras`
jprochazk ec79d88
impl `From<Vec2>` for `SizeHint`
jprochazk 1934fba
re-export `SizeHint` from `egui` root
jprochazk 5b113d5
rework `svg` example to use new managed `Image`
jprochazk c1443b9
split loaders into separate files + add logging
jprochazk f6efd05
add `log_trace`
jprochazk 652432a
clean up `RetainedImage` from `svg` example
jprochazk 015dc84
refactor ehttp loader response to bytes mapping
jprochazk 80dd53c
remove spammy trace
jprochazk eceeda8
load images even without extension
jprochazk 022d5a0
fix lints
jprochazk 6819ea3
remove unused imports
jprochazk d954175
use `Image2` in `download_image`
jprochazk 9ae51a2
use `visuals.error_fg_color` in `Image2` error state
jprochazk aea252d
update lockfile
jprochazk c2ecc34
use `Arc<ColorImage>` in `ImageData` + add `forget` API
jprochazk 52f3529
add `ui.image2`
jprochazk 08951f1
add byte size query api
jprochazk 41b074c
use iterators to sum loader byte sizes
jprochazk 6b0a653
add static image loading
jprochazk 3fc03c3
use static image in `svg` example
jprochazk 78f2d93
small refactor of `Image2::ui` texture loading code
jprochazk 4080b8f
add `ImageFit` to size images properly
jprochazk 2584fa8
remove println calls
jprochazk 3182c9d
add bad image load to `download_image` example
jprochazk ae0c6c1
add loader file extension support tests
jprochazk 4cfec50
fix lint errors in `loaders`
jprochazk a10a88c
remove unused `poll-promise` dependency
jprochazk a8ae600
add some docs to `Image2`
jprochazk 08cb30b
add some docs to `egui_extras::loaders::install`
jprochazk 2c8be3c
explain `loaders::install` in examples
jprochazk 808e249
fix lint
jprochazk 1d9a7ed
upgrade `ehttp` to `0.3` for some crates
jprochazk d109db4
Remove some unused dependencies
emilk 9544b02
Remove unnecessary context clone
emilk 3f194cc
Turn on the `log` create feature of egui_extras in all examples
emilk 2962067
Merge branch 'master' into improved-texture-loading
emilk 0dbaef0
rename `forget` and document it
jprochazk f6104b9
derive `Debug` on `SizeHint`
jprochazk 1bfd26e
round when converting SizeHint from vec2
jprochazk 2a687b7
add `load` module docs
jprochazk 817b956
docstring `add_loader` methods
jprochazk b733a58
expose + document `load_include_bytes`
jprochazk 1aacf42
cache texture handles in `DefaultTextureLoader`
jprochazk 356d7ef
add `image2` doctest + further document `Image2`
jprochazk 0d28132
use `Default` for default `Image2` options
jprochazk afa3ef3
update `image2` doc comment
jprochazk a3c890d
mention immediate-mode safety
jprochazk f975d83
more fit calculation into inherent impl
jprochazk 98ddf02
add hover text on spinner
jprochazk 2736cb5
add `all-loaders` feature
jprochazk ef71ea2
clarify `egui_extras::loaders::install` behavior
jprochazk 76b5e74
explain how to enable image formats
jprochazk 30f0e0f
properly format `uri`
jprochazk c84e9ab
use `thread::Builder` instead of `spawn`
jprochazk d21e74e
use eq op instead of `matches`
jprochazk 59cd614
inline `From<Arc<ColorImage>>` for `ImageData`
jprochazk 4206355
allow non-`'static` bytes + `forget` in `DefaultTextureLoader`
jprochazk f0e9733
sort features
jprochazk 049122f
change `ehttp` feature to `http`
jprochazk c8a8074
update `Image2` docs
jprochazk ef7e946
refactor loader cache type
jprochazk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
We should consider how we can alert the user of methods that aren't immediate safe, most notably the old
Context::load_texture
. Adding a⚠️ Not immediate-mode safe
warning to them might be a start, but perhaps we could also add it to their name somehow.load_texture_sync
or something.