In https://github.com/emilk/egui/pull/1154 the default was set to
16k x 512, which is way excessive, as most of it will be blank.
This PR changes it to 8k x 64, which will make egui
use less RAM and VRAM, and load quicker again.
This also decreases the max size from 16k² to 8k².
That should be enough.
* Fix Orientation not exposed, although there are public fields with its type
* Implement formatters for X/Y axis labels
* Use array instead of separate X/Y formatters
* Swap axis formatters if charts are horizontal
* Review suggestions
* Refactor text layout: don't need &Fonts in all functions
* Replace indexing in Fonts with member function
* Wrap Fonts in a Mutex
* Remove mutex for Font::glyph_info_cache
* Remove RwLock around Font::characters
* Put FontsImpl and GalleyCache behind the same Mutex
* Round font sizes to whole pixels before deduplicating them
* Make TextStyle !Copy
* Implement user-named TextStyle:s
* round font size earlier
* Cache fonts based on family and size
* Move TextStyle into egui and Style
* Remove body_text_style
* Query graphics about max texture size and use that as font atlas size
* Recreate texture atlas when it is getting full
* Move texture allocation into epaint/egui proper
* Add TextureHandle
* egui_glow: cast using bytemuck instead of unsafe code
* Optimize glium painter
* Optimize WebGL
* Add example of loading an image from file
* Re-add check of WEBGL_debug_renderer_info to avoid OpenGL error
I removed this check in https://github.com/emilk/egui/pull/1020
because it produced a warning on Firefox. Better a warning
than an OpenGL error though.
* Bug fix: don't ask for webgl context and then later for webgl2 context
The browser will only allow the first thing we check, so this will
prevent webgl2 from working.
* Move all interior mutability from Context to CtxRef and make it a handle
* Rename `CtxRef` to `Context`
* The old `Context` is now `ContextImpl` and is non-pub
* Add benchmark Painter::rect
Co-authored-by: Daniel Keller <dklr433@gmail.com>
* Split `Event::Text` into `Text` and `Paste`
* Added explicit Event::Paste change
See #1043
* Link to PR in changelog (not the issue)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Allow setting the scale filter for `glow` backend
This commit adds a `set_scale_filter` method to the `glow` painter so that
textures can be set to scale using nearest-neighbour scaling rather than
linear. This is useful for pixel art.
I wasn't entirely sure what kind of API you want for this kind of change so I
went with what seemed least intrusive, I don't mind doing something more
holistic if this isn't what you had in mind.
* Rename scale_filter -> texture_filter
* Store the TextureFilter directly
* PR link in changelog
* Use inter-doc links
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Replace `std::time::Instant` with wasm-compatible `instant::Instant`
* Change version requirement for instant to be compatible to winit
* Enable wasm-bindgen feature for instant
* Update lockfile
* Update changelog
* sort dependencies
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Switch to using glow as the default renderer both on native and the web
* Simplify code to find WebGL context for glow
* egui_web: make webgl an opt-in feature
* Stop using deprecated WEBGL_debug_renderer_info
* add spinner widget
* implement requested changes to spinner
- removed enabled field
- cleaned up math
- improved docs
* improve spinner docs & make spinner in demo always active
`begin_frame`, `end_frame` is more convenient when using egui in a game engine. In particular, 0.16.0 was incompatible with https://github.com/mvlabat/bevy_egui>.