Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6c131a1
init egui_glow_painter by copy egui_glow painter
Oct 20, 2021
92746f8
add context create function for web
Oct 20, 2021
e4a022f
delete egui_glow painter and use egui_glow_painter
Oct 20, 2021
48dde27
install glow painter to web (crash)
Oct 20, 2021
124e9cd
correctly init webgl context
Oct 20, 2021
bc2678f
eliminate crash but black screen on webgl1
Oct 22, 2021
6f3ccb6
webgl1 progress but srgb support yet.
Oct 23, 2021
d7af224
interim commit for tracking upstream
KentaTheBugMaker Oct 25, 2021
8e992d5
merge upstream
KentaTheBugMaker Oct 25, 2021
f1d6113
fix broken when merge upstream
KentaTheBugMaker Oct 25, 2021
ea5c2a5
Merge branch 'emilk:master' into master
KentaTheBugMaker Oct 28, 2021
6f33e86
port post process from web
KentaTheBugMaker Oct 28, 2021
f130bdf
share WebGL2 and OpenGL shader
KentaTheBugMaker Oct 28, 2021
43631e7
fix WebGL1 with sRGB support.
KentaTheBugMaker Oct 28, 2021
ac9c263
rollback eframe modding
KentaTheBugMaker Oct 28, 2021
1417755
pass sRGB support status from painter using #define SRGB_SUPPORTED
KentaTheBugMaker Oct 28, 2021
8cf5a41
webGL1 with sRGB works well
KentaTheBugMaker Oct 28, 2021
8f33833
fmt
KentaTheBugMaker Oct 29, 2021
cc2f325
tomlfmt
KentaTheBugMaker Oct 29, 2021
5bda67a
fmt
KentaTheBugMaker Oct 29, 2021
dacab37
small refactoring
KentaTheBugMaker Oct 29, 2021
089ea47
don't squash shader compile and link errors
KentaTheBugMaker Oct 29, 2021
d2c7e76
some clippy fix
KentaTheBugMaker Oct 29, 2021
022e36a
split painter to small pieces.
KentaTheBugMaker Oct 30, 2021
d588030
fmt
KentaTheBugMaker Oct 30, 2021
1cd0bb7
add VAO emulate code to webgl1 compatibility
KentaTheBugMaker Oct 30, 2021
23edc3e
use emulated vao in painter
KentaTheBugMaker Oct 30, 2021
4194090
reintroduce panic and assert
KentaTheBugMaker Oct 30, 2021
de474b1
write changelog and implement NativeTexture trait
KentaTheBugMaker Oct 30, 2021
ff0850e
fmt
KentaTheBugMaker Oct 30, 2021
c7510cf
merge upstream
KentaTheBugMaker Oct 30, 2021
f7e5e62
disable vertex attributes when finish painting.
KentaTheBugMaker Oct 31, 2021
5e2f50c
fix doc
KentaTheBugMaker Oct 31, 2021
8798c75
fix doc
KentaTheBugMaker Oct 31, 2021
3c0325a
fmt
KentaTheBugMaker Oct 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 73 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
[workspace]
resolver = "2"
members = [
"egui_demo_app",
"egui_demo_lib",
"egui_glium",
"egui_glow",
"egui_web",
"egui-winit",
"egui",
"emath",
"epaint",
"epi",
members = ["egui_demo_app", "egui_demo_lib", "egui_glium", "egui_glow", "egui_glow_painter", "egui_web", "egui-winit", "egui", "emath", "epaint", "epi",
]
resolver = "2"

[profile.dev]
split-debuginfo = "unpacked" # faster debug builds on mac
Expand Down
2 changes: 1 addition & 1 deletion eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ egui_glow = { version = "0.15.0", path = "../egui_glow", default-features = fals
# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
egui_web = { version = "0.15.0", path = "../egui_web", default-features = false }

console_error_panic_hook = "0.1.7"
[dev-dependencies]
image = { version = "0.23", default-features = false, features = ["png"] }
rfd = "0.5.0"
Expand Down
4 changes: 3 additions & 1 deletion eframe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ pub use {egui, epi};

#[cfg(not(target_arch = "wasm32"))]
pub use epi::NativeOptions;

#[cfg(target_arch = "wasm32")]
use std::panic;
// ----------------------------------------------------------------------------
// When compiling for web

Expand Down Expand Up @@ -103,6 +104,7 @@ pub use egui_web::wasm_bindgen;
/// ```
#[cfg(target_arch = "wasm32")]
pub fn start_web(canvas_id: &str, app: Box<dyn epi::App>) -> Result<(), wasm_bindgen::JsValue> {
panic::set_hook(Box::new(console_error_panic_hook::hook));
egui_web::start(canvas_id, app)?;
Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions egui-winit/src/epi.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(target_os = "windows")]
use winit::platform::windows::WindowBuilderExtWindows;
pub fn window_builder(
native_options: &epi::NativeOptions,
window_settings: &Option<crate::WindowSettings>,
Expand Down
2 changes: 1 addition & 1 deletion egui_glow/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ All notable changes to the `egui_glow` integration will be noted in this file.


## Unreleased

* painter separated to new crate egui_glow_painter that support web and native.

## 0.15.0 - 2021-10-24
`egui_glow` has been newly created, with feature parity to `egui_glium`.
Expand Down
2 changes: 1 addition & 1 deletion egui_glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ all-features = true
egui = { version = "0.15.0", path = "../egui", default-features = false, features = ["single_threaded"] }
egui-winit = { version = "0.15.0", path = "../egui-winit", default-features = false, features = ["epi"] }
epi = { version = "0.15.0", path = "../epi", optional = true }

egui_glow_painter={version ="0.15.0",path="../egui_glow_painter"}
glow = "0.11"
glutin = "0.27"
memoffset = "0.6"
Expand Down
17 changes: 0 additions & 17 deletions egui_glow/src/epi_backend.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
use crate::*;
use egui::Color32;
#[cfg(target_os = "windows")]
use glutin::platform::windows::WindowBuilderExtWindows;
use std::time::Instant;

impl epi::TextureAllocator for Painter {
fn alloc_srgba_premultiplied(
&mut self,
size: (usize, usize),
srgba_pixels: &[Color32],
) -> egui::TextureId {
let id = self.alloc_user_texture();
self.set_user_texture(id, size, srgba_pixels);
id
}

fn free(&mut self, id: egui::TextureId) {
self.free_user_texture(id);
}
}

struct RequestRepaintEvent;

struct GlowRepaintSignal(std::sync::Mutex<glutin::event_loop::EventLoopProxy<RequestRepaintEvent>>);
Expand Down
Loading