Giter Club home page Giter Club logo

Comments (10)

Gonkalbell avatar Gonkalbell commented on May 14, 2024 1

I just uploaded https://github.com/Gonkalbell/egui_wgpu, which is a pretty lazy port of the glium bindings. I haven't gotten around to uploading the documentation to docs.rs or publishing this to crates.io yet, but maybe you can find it useful.

from egui.

emilk avatar emilk commented on May 14, 2024

Hello!

A good place to start is probably to look at how the rendering is done for Glium: https://github.com/emilk/egui/blob/master/egui_glium/src/painter.rs

from egui.

IceSentry avatar IceSentry commented on May 14, 2024

So I've been working on my implementation here https://github.com/IceSentry/bevy_prototype_egui_plugin

I was about to start the painter based on glium, but I keep getting a crash saying No fonts available. I've been looking everywhere in the glium examples and egui_glium and I can't figure out how fonts are loaded.

from egui.

IceSentry avatar IceSentry commented on May 14, 2024

Also, just to be sure. it seems like implementing App and Backend isn't actually required. Is this true or did I miss something?

from egui.

IceSentry avatar IceSentry commented on May 14, 2024

I figured out my font bug. It was an issue with the ordering of the update calls.

from egui.

emilk avatar emilk commented on May 14, 2024

it seems like implementing App and Backend isn't actually required

You are correct!

egui::app is a model I introduced for writing backend agnostic apps. The goal is that you can write e.g. a calculator app that implements egui::app::App and then easily compile it for different Egui backends that implements egui::app::Backend (such as egui_glium and egui_web). It is still quite experimental.

from egui.

emilk avatar emilk commented on May 14, 2024

I've added this section to README.md:

You need to collect egui::RawInput, paint egui::PaintJobs and handle egui::Output. The basic structure is this:

let mut egui_ctx = egui::Context::new();

// game loop:
loop {
    let raw_input: egui::RawInput = my_backend.gather_input();
    let mut ui = egui_ctx.begin_frame(raw_input);
    my_app.ui(&mut ui); // add windows and widgets to `ui` here
    let (output, paint_jobs) = egui_ctx.end_frame();
    my_backend.paint(paint_jobs);
    my_backend.set_cursor_icon(output.cursor_icon);
    // Also see `egui::Output` for more
}

from egui.

IceSentry avatar IceSentry commented on May 14, 2024

I saw that, thank you, it was helpful. Now I just need to figure out how to draw the triangles in bevy and I think I'll be set.

from egui.

IceSentry avatar IceSentry commented on May 14, 2024

Oh cool, thanks, I'll look at it. I kind of stopped working on this.

from egui.

emilk avatar emilk commented on May 14, 2024

It seems like we have TWO wgpu backends for Egui now:

So I will consider this issue closed!

from egui.

Related Issues (20)

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.