Commit graph

132 commits

Author SHA1 Message Date
Emil Ernerfeldt
e1bcaeebe5 App::clear_color: give egui::Visuals as argument 2022-04-30 15:41:43 +02:00
Emil Ernerfeldt
bb421c7e8a
Remove egui_web and epi (#1545)
* Remove integration name (it is always eframe)

* Remove egui_web crate

* Move egui_web/CHANGELOG.md into eframe/CHANGELOG.md

* Remove all mentions of egui_web

* Remove epi crate and absorb into eframe

* egui_glow: only use puffin on native

* Remove WASM doc from CI (we don't generate it anyways!)

* Remove eframe::epi and improve eframe docs
2022-04-30 10:44:35 +02:00
Emil Ernerfeldt
ed002acc68
Refactor: move things into eframe (#1542)
* Move all epi-related code from egui_glow into eframe

* Move epi stuff from egui-winit into eframe

* Remove mention of epi in egui

* Remove mention of epi in egui_glium

* Remove trait epi::NativeTexture

* Remove confusing mentions of epi

* Refactor egui_web: break up into smaller files

* Clean up feature flags further, and update changelogs

* Clean up check.sh

* Small cleanup of egui_web/Cargo.toml

* Fix dependencies for pure_glow example

* Fix clippy false positive
2022-04-29 08:17:49 +02:00
Emil Ernerfeldt
558891c146 eframe native: persist app state in background thread
Gives smoother frame rate
2022-04-19 21:26:35 +02:00
Stanisław Jelnicki
2745699bd6
Add Ui::spinner shortcut method (#1494) 2022-04-15 07:39:08 +02:00
Emil Ernerfeldt
a7b6334784 Misc doc improvements 2022-04-13 22:14:34 +02:00
Emil Ernerfeldt
2ae93c40ab
Move examples out of eframe/examples into examples/ (#1486)
* Move examples out of eframe/examples into examples/

Give each example a `Cargo.toml` and `src/main.rs`.
This makes it easier for people to use as templates.

* Update README.md with more deps needed on vanilla Ubuntu
* Install libgtk-3-dev on CI, hoping that will fix something
2022-04-13 16:13:24 +02:00
Emil Ernerfeldt
170b21b63e
Add opt-in support for the 'puffin' profiler in eframe (#1483) 2022-04-13 11:06:13 +02:00
Emil Ernerfeldt
917f9e1768 Refactor and simplify feature flags 2022-04-11 10:53:16 +02:00
Emil Ernerfeldt
9b37c82d46 Update three-d to 0.11 2022-04-10 10:00:57 +02:00
Emil Ernerfeldt
cf0338d48f
Rust 1.60.0 + refactor cargo features (#1467)
* Update to rust 1.60.0
* Rename the feature `convert_bytemuck` to `bytemuck`
* Rename the feature `serialize` to `serde`.
* Make use of the "weak dependency" cargo feature
* Set rust-version = "1.60" for all crates
* egui_glow: clipboard, links, persistence & winit are now opt-in features
2022-04-09 13:54:47 +02:00
Emil Ernerfeldt
10f30a0c52
Fix tessellation of Shape::Vec of heterogenous TextureId:s (#1445)
Closes https://github.com/emilk/egui/issues/1443
2022-04-03 18:14:27 +02:00
Emil Ernerfeldt
95efbbc03e
Remember to update glow window size when DPI changes (#1441) 2022-04-03 10:20:49 +02:00
Collin Kemper
a52bbade45
Place dark-light behind a feature gate in eframe and egui_glow (#1437) 2022-04-01 11:10:47 +02:00
Emil Ernerfeldt
8f178fa4e0
Add glow::Context to epi::Frame (#1425)
This can be used, for instance, to:

* Render things to offscreen buffers.
* Read the pixel buffer from the previous frame (glow::Context::read_pixels).
* Render things behind the egui windows.
2022-03-27 15:20:45 +02:00
Emil Ernerfeldt
b7ebe16cfb
Storage and frame refactor (#1418)
The purpose of this is to expose `frame.storage()` and `frame.storage_mut()` so users can save/load app state from the `App::update` function, without having to add another parameter to that function.

Changes:
* Added `Frame::storage()` and `Frame::storage_mut()`
* `App::update` now takes a `&mut Frame` rather than just `&Frame`
* `Frame` is no longer `Clone` or `Sync` (doesn't have to be since https://github.com/emilk/egui/pull/1366)
2022-03-25 21:19:31 +01:00
Emil Ernerfeldt
a9fd03709e Add new NativeOptions: vsync multisampling depth_buffer stencil_buffer
These are useful when embedding 3D into eframe.
2022-03-23 11:13:57 +01:00
Emil Ernerfeldt
c63bdeab67
Add an example of showing 3D using three-d (#1407) 2022-03-23 11:06:33 +01:00
Emil Ernerfeldt
ea9393aa9b
glow painter improvements (#1406)
* Add viewport info to PaintCallback
* glow: be more explicit with more state
* glow: Refactor VAO
2022-03-22 23:11:27 +01:00
Emil Ernerfeldt
41b178b6ec
Use atomic_refcell instead of parking_lot for wasm32 targets (#1404)
Closes https://github.com/emilk/egui/issues/1401
2022-03-22 15:34:21 +01:00
Hunter522
0a400a5bcc
Add Image::rotate and Mesh::rotate (#1371)
Co-authored-by: Hunter Morgan <hmorgan@bellflight.com>
2022-03-22 08:44:23 +01:00
Emil Ernerfeldt
805539b50d
Add example of custom window frame for native window using eframe (#1396) 2022-03-21 22:20:58 +01:00
Emil Ernerfeldt
5c68edbb15 Clippy fixes 2022-03-21 22:14:25 +01:00
Emil Ernerfeldt
fda8189cba
Move lints list to .carg/config.toml (#1394)
That way they apply to all crates equally.

See https://github.com/EmbarkStudios/rust-ecosystem/issues/22 for why.
2022-03-21 16:54:29 +01:00
Emil Ernerfeldt
465c96122c
egui_web: by default, use full web browser size (#1378)
* egui_web: by default, use full web browser size

Closes https://github.com/emilk/egui/issues/1377

* Remove max_size_points from demo app
2022-03-19 13:47:30 +01:00
Emil Ernerfeldt
c69f39e869
Box the app creator (#1373) 2022-03-18 14:23:07 +01:00
Emil Ernerfeldt
c8f6cae362
eframe app creation refactor (#1363)
* Change how eframe apps are created
* eframe: re-export epi::* so users don't need to care about what epi is
2022-03-16 15:39:48 +01:00
Emil Ernerfeldt
c768d1d48e
Context::request_repaint will wake up the UI thread (#1366)
This adds a callback (set by `Context::set_request_repaint_callback`)
which integration can use to wake up the UI thread.

eframe (egui_web and egui_glow) will use this, replacing
`epi::Frame::request_repaint`.

Existing code calling `epi::Frame::request_repaint` should be changed
to instead call `egui::Context::request_repaint`.

This is the first callback added to the egui API, which otherwise is
completely driven by data.

The purpose of this is to remove the confusion between the two
`request_repaint` methods (by removing one). Furthermore, it makes
`epi::Frame` a lot simpler, allowing future simplifications to it
(perhaps no longer having it be `Send+Sync+Clone`).
2022-03-15 17:21:52 +01:00
Emil Ernerfeldt
6aee4997d4
Add Shape::Callback to do custom rendering inside of an egui UI (#1351)
* Add Shape::Callback to do custom rendering inside of an egui UI
* Use Rc<glow::Context> everywhere
* Remove trait WebPainter
* Add glow::Context to epi::App::setup
2022-03-14 13:25:11 +01:00
Emil Ernerfeldt
50539bd31a
egui_web: always use the glow painter, and remove the old WebGL code. (#1356)
* egui_web: always use the glow painter, and remove the old WebGL code.
* Clean up the WebPainter trait
* Clarify WebGL1 warning text in color test

The glow painter became standard in egui 0.17, and I've heard no complaints! So let's simplify and go all in on glow.

Part of https://github.com/emilk/egui/issues/1198
2022-03-11 19:15:06 +01:00
Emil Ernerfeldt
52b4ab4e18
Remove egui_glium as a backend for eframe (#1357)
eframe will now always use egui_glow as a native backend.

Part of https://github.com/emilk/egui/issues/1198
2022-03-11 19:14:27 +01:00
Emil Ernerfeldt
510cef02ca Run a formatter on all toml files 2022-03-10 14:25:33 +01:00
Zachary Kohnen
27e179268b
Remove warning about cpal drag and drop (#1329)
* Remove warning about cpal drag and drop

Given that the issue https://github.com/rust-windowing/winit/issues/1255 was closed by https://github.com/rust-windowing/winit/pull/1524, it would make sense to remove the warning about the issue from NativeOptions

* Change `NativeOptions::drag_and_drop_support` default to true
2022-03-07 10:33:59 +01:00
Emil Ernerfeldt
a05520b9d3 Release 0.17.0 - Improved font selection and image handling 2022-02-22 19:32:30 +01:00
Emil Ernerfeldt
6d68838821 Clean up changelogs 2022-02-21 16:10:05 +01:00
Emil Ernerfeldt
ddf914b517
Update crates (#1283)
* Update rfd 0.8 -> 0.8

* Update webbrowser 0.5 -> 0.6

* Update unicode_names2 0.4 -> 0.5

* cargo update

    Updating crates.io index
      Adding arrayvec v0.7.2
    Updating async-lock v2.4.0 -> v2.5.0
    Updating autocfg v1.0.1 -> v1.1.0
    Updating cc v1.0.72 -> v1.0.73
    Updating cfg-expr v0.9.1 -> v0.10.1
    Updating core-foundation v0.9.2 -> v0.9.3
    Updating crc32fast v1.3.1 -> v1.3.2
    Updating crossbeam-epoch v0.9.6 -> v0.9.7
    Updating crossbeam-utils v0.8.6 -> v0.8.7
    Updating deflate v0.9.1 -> v1.0.0
    Removing encoding v0.2.33
    Removing encoding-index-japanese v1.20141219.5
    Removing encoding-index-korean v1.20141219.5
    Removing encoding-index-simpchinese v1.20141219.5
    Removing encoding-index-singlebyte v1.20141219.5
    Removing encoding-index-tradchinese v1.20141219.5
    Removing encoding_index_tests v0.1.4
    Updating enum-map v2.0.1 -> v2.0.2
    Updating futures-core v0.3.19 -> v0.3.21
    Updating futures-io v0.3.19 -> v0.3.21
    Updating futures-sink v0.3.19 -> v0.3.21
    Updating futures-task v0.3.19 -> v0.3.21
    Updating futures-util v0.3.19 -> v0.3.21
    Updating gio-sys v0.15.4 -> v0.15.6
    Updating glib-sys v0.15.4 -> v0.15.6
    Updating gobject-sys v0.15.1 -> v0.15.5
    Updating image v0.24.0 -> v0.24.1
    Updating kurbo v0.8.0 -> v0.8.3
    Updating libc v0.2.117 -> v0.2.119
    Updating memmap2 v0.5.2 -> v0.5.3
      Adding miniz_oxide v0.5.1
      Adding ndk-context v0.1.0
    Removing ndk-glue v0.5.0
    Removing ndk-glue v0.6.0
      Adding ndk-glue v0.5.1
      Adding ndk-glue v0.6.1
    Updating ntapi v0.3.6 -> v0.3.7
    Updating png v0.17.2 -> v0.17.3
    Updating proc-macro-crate v1.1.0 -> v1.1.2
    Updating rand v0.8.4 -> v0.8.5
    Removing rand_hc v0.3.1
    Updating rustls v0.20.2 -> v0.20.4
    Updating semver v1.0.4 -> v1.0.5
    Updating serde_json v1.0.78 -> v1.0.79
    Updating system-deps v6.0.1 -> v6.0.2
    Updating tracing v0.1.30 -> v0.1.31
    Updating tracing-subscriber v0.3.7 -> v0.3.9
    Updating tts v0.20.2 -> v0.20.3
    Removing windows v0.30.0
    Removing windows_aarch64_msvc v0.30.0
    Removing windows_i686_gnu v0.30.0
    Removing windows_i686_msvc v0.30.0
    Removing windows_x86_64_gnu v0.30.0
    Removing windows_x86_64_msvc v0.30.0
2022-02-21 15:40:25 +01:00
Emil Ernerfeldt
c3fc8997d6
Introduce egui_extras with RetainedImage for loading svg,png,jpeg,… (#1282) 2022-02-21 15:26:26 +01:00
Emil Ernerfeldt
89d19860b8 Misc code cleanup, docs fixes, etc 2022-02-19 20:58:28 +01:00
Emil Ernerfeldt
3d754e3a16
Prevent ScrollArea:s from becoming tiny (#1255)
Closes https://github.com/emilk/egui/issues/1097
2022-02-17 17:08:05 +01:00
Emil Ernerfeldt
b5c8f034e7
Add web location info to egui_web/epi (#1258)
This adds all parts of the web "location" (URL) to frame.info().web_info, included a HashMap of the query parameters, percent-decoded and ready to go.

This lets you easily pass key-value pairs to your eframe web app.
2022-02-17 16:46:43 +01:00
Emil Ernerfeldt
defc400c21
Add an example of how to display an SVG image in egui (#1228) 2022-02-09 08:12:12 +01:00
Emil Ernerfeldt
cbc53fbe2e eframe: Add epi::NativeOptions::initial_window_pos 2022-02-05 19:12:03 +01:00
Emil Ernerfeldt
0fa4bb9c64 Clean up all Cargo.toml: put features higher, and document them better 2022-02-05 11:11:15 +01:00
Emil Ernerfeldt
1b623fdd34 Update rfd 0.6 -> 0.7 2022-02-04 13:31:06 +01:00
Emil Ernerfeldt
47038c631e Update image 0.23 -> 0.24 2022-02-04 13:31:06 +01:00
Emil Ernerfeldt
c3be566574
egui-winit: Automatically detect and apply dark or light mode (#1045) 2022-02-02 17:09:36 +01:00
Emil Ernerfeldt
c6ac1827f6
Use tracing crate for logging (#1192)
* egui_web: use tracing crate
* egui_glow: use tracing crate
* Log at the debug level
* egui_demo_app: enable tracing to log to stdout
* Use tracing in egui-winit
* Add opt-in tracing support to egui
2022-02-01 12:27:39 +01:00
Emil Ernerfeldt
fa43d16c41
Choose your own font and size (#1154)
* 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
2022-01-24 14:32:36 +01:00
bthehacker
dba949240f
Fix eframe changelog links to other changelogs (#1146)
Links to the changelogs of egui_web, egui-winit, and egui_glium were broken and led to a 404, fixed them by adding "../"
2022-01-22 11:33:39 +01:00
Emil Ernerfeldt
a689b623a6
Make shift-scroll do horizontal scrolling on all platforms (#1136)
Closes https://github.com/emilk/egui/issues/1135
2022-01-21 10:48:44 +01:00