Is the idea of using egui as a desktop framework feasible? #4512
Aladdinslamp
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using egui, I encountered an issue. My initial idea was to use egui as a desktop framework on the web and implement various application interfaces using windows controls. However, I realized during implementation that wasm currently does not support dynamic linking. According to the information provided here (https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md), only Emscripten has implemented it, but it is in C. If it is possible to achieve dynamic linking for egui using wasm32-unknown-emscripten, it would be ideal. However, the glow library in eframe cannot be compiled with it. On the other hand, there are no issues with wasm32-unknown-unknown. Is it necessary to write my own runtime, or are there any other methods available?
Even if using Emscripten, it is not certain whether FFI with dlopen is required. Therefore, I am hesitant and would like to ask for suggestions from everyone.
The issue with Emscripten compilation is as follows:
cargo build --target=wasm32-unknown-emscripten
--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.27.0\src\web\web_painter_glow.rs:118:29
|
118 | let gl = glow::Context::from_webgl1_context(gl1_ctx);
| ^^^^^^^^^^^^^^^^^^^ function or associated item not found in
Context
|
note: if you're trying to build a new
glow::Context
consider using one of the following associated functions:glow::Context::from_loader_function_cstr
glow::Context::from_loader_function
--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\glow-0.13.1\src\native.rs:42:5
|
42 | / pub unsafe fn from_loader_function_cstr(mut loader_function: F) -> Self
43 | | where
44 | | F: FnMut(&CStr) -> *const std::os::raw::c_void,
| |_^
...
104 | / pub unsafe fn from_loader_function(mut loader_function: F) -> Self
105 | | where
106 | | F: FnMut(&str) -> *const std::os::raw::c_void,
| |^
error[E0599]: no function or associated item named
from_webgl2_context
found for structglow::Context
in the current scope--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.27.0\src\web\web_painter_glow.rs:134:29
|
134 | let gl = glow::Context::from_webgl2_context(gl2_ctx);
| ^^^^^^^^^^^^^^^^^^^ function or associated item not found in
Context
|
note: if you're trying to build a new
glow::Context
consider using one of the following associated functions:glow::Context::from_loader_function_cstr
glow::Context::from_loader_function
--> D:\RustEnv\CargoCache\registry\src\index.crates.io-6f17d22bba15001f\glow-0.13.1\src\native.rs:42:5
|
42 | / pub unsafe fn from_loader_function_cstr(mut loader_function: F) -> Self
43 | | where
44 | | F: FnMut(&CStr) -> *const std::os::raw::c_void,
| |_^
...
104 | / pub unsafe fn from_loader_function(mut loader_function: F) -> Self
105 | | where
106 | | F: FnMut(&str) -> *const std::os::raw::c_void,
| |^
Beta Was this translation helpful? Give feedback.
All reactions