Giter Club home page Giter Club logo

Comments (10)

khionu avatar khionu commented on May 24, 2024 1

Glutin locks us into an OpenGL rendering context, which could very well be unwanted by our users. We shouldn't use a rendering context beyond the web view, that should entirely be on the user.

For a hard counter example, Amethyst is using Tauri for their editor. Eventually, they will be rendering games in another window spawned in the same process, via our Multi-Window pattern.

from webview_rust.

tensor-programming avatar tensor-programming commented on May 24, 2024

Regarding Winit, it might be better to go a little higher level and use something like Glutin instead. It gives us an API to openGL and we could use it to generate custom native components on the webview window. Things like context menus and buttons. Since Glutin uses Winit in the backend, we get all of that functionality as well.

from webview_rust.

tensor-programming avatar tensor-programming commented on May 24, 2024

Thats fine, we can create a wrapper abstraction to allow the user to strip off glutin as a feature and use their own renderer. I just feel that it would give us some nice default patterns over using something as low level as winit.

from webview_rust.

nothingismagick avatar nothingismagick commented on May 24, 2024

from webview_rust.

khionu avatar khionu commented on May 24, 2024

What I would rather do is have that contained to the updater. Rendering engines aren't small, including any unless they're actually needed, or wanted by the user, is bloat, in both binary size and compile times.

from webview_rust.

khionu avatar khionu commented on May 24, 2024

Even if we want to use Glutin with a feature flag, the work for Winit so we can be sans-renderer will have to be done. It's a better default.

from webview_rust.

khionu avatar khionu commented on May 24, 2024

It turns out that WebviewGTK will not work with Winit. Solving the multi-window/GL concerns will take more research than this issue can afford at this point.

I'm handing off this work, so I'll outline what needs to be done:

  1. In a new repo, we need create a set of Rust-safe bindings over ZSerge. The Rust bindgen tooling doesn't work with ZSerge, so this will have to be done by hand. After writing the extern 'C' functions, the Rust API should be minimal as to ensure the FFI-required unsafe is safely encapsulated. Where ZSerge passes a Window Pointer, we can pass null, and let ZSerge spawn the windows, until we are ready to solve the multi-window/GL concerns.

  2. tauri-view can have the submodule for ZSerge removed, and that can be added to the new repo. tauri-view should wrap the new bindings with the existing abstraction in tauri-utils. Said abstraction needs window_handle removed for the time being.

  3. The rest of Tauri can then be updated to use tauri_utils::WebView as the concrete wrapper around any web view stack. The bundler should default to using tauri-view, but be configurable to accept a fully-resolved type (includes crate and module path) that implements the WebViewBindingtrait.

from webview_rust.

carbotaniuman avatar carbotaniuman commented on May 24, 2024

I'll take care of building the Rust bindings to Webview.

from webview_rust.

nothingismagick avatar nothingismagick commented on May 24, 2024

Not sure if this should stay open, but it seemed better placed here than in the core repo.

from webview_rust.

nothingismagick avatar nothingismagick commented on May 24, 2024

Closing as off topic.

from webview_rust.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.