-1

I wanted to make a simple automation game using Rust, I first tried Bevy but didn't like ECS. So I found Macroquad, which looked great, but the ui was messy and I found it hard to use, so I wanted to use egui-macroquad to use egui for ui's which looked much nicer. When I add egui-macroquad version 0.15 to my project, I have no errors, same using egui version 0.22 If I copy the code provided in the README.md of egui-macroquad the code doesn't compile:

   --> src\main.rs:12:23
    |
12  |                 .show(egui_ctx, |ui| {
    |                  ---- ^^^^^^^^ expected `egui::Context`, found `Context`
    |                  |
    |                  arguments to this method are incorrect
    |
    = note: `Context` and `egui::Context` have similar names, but are actually distinct types
note: `Context` is defined in crate `egui`

EDIT: I can use egui_macroquad::egui::Window and it works.

And if I remove the errory part, just keep egui_macroquad::draw(), I get a BIG linker error: error LNK2005: CONTEXT already defined in libmacroquad-a3cb7b92d2a1ff40.rlib(macroquad-a3cb7b92d2a1ff40.macroquad.b0373709-cgu.6.rcgu.o) [...]

I then tried cloning egui-macroquad with updated versions of egui etc: https://github.com/ProfAndreaPollini/egui-macroquad.git

But It didn't compile... What am I supposed to do ?

EDIT: After testing, any version of macroquad below 0.4 works but I wanna use the latest version

Sxmourai
  • 9
  • 1
  • 1
    looks like a dependency mismatch, the [latest version of egui-macroquad](https://crates.io/crates/egui-macroquad/0.15.0/dependencies) depends on egui v0.21 and macroquad v0.3 – kmdreko Aug 29 '23 at 16:12
  • Yes but how am I supposed to fix it ? I wanna use the latest version – Sxmourai Aug 30 '23 at 06:40
  • Sorry, it doesn't look like there's a version compatible with egui v0.22 or macroquad v0.4. Both those releases have been in the last few months so maybe just give it some time or make a PR to the egui-macroquad repo to update it. – kmdreko Aug 30 '23 at 16:34
  • Okay thx... I'll make a PR – Sxmourai Aug 30 '23 at 16:35
  • But there's already an issue... 1 month old – Sxmourai Aug 30 '23 at 16:37
  • If its that important and you're prepared to make a PR regardless, you obviously can fork it, update the deps, and use that fork in your own program. But that's just about the extent of your options. /shrug – kmdreko Aug 30 '23 at 16:47
  • I tried updating everything, but it wasn't compiling, because egui-miniquad still uses version 0.3.26 of macroquad... I tried updating myself but idk much of macroquad and I don't know anything about the code base so I wasn't able to update it myself :c – Sxmourai Aug 31 '23 at 06:10

0 Answers0