Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egui support #22

Open
Alleexxi opened this issue Aug 10, 2022 · 12 comments
Open

egui support #22

Alleexxi opened this issue Aug 10, 2022 · 12 comments

Comments

@Alleexxi
Copy link

title says everything

@veeenu
Copy link
Owner

veeenu commented Aug 10, 2022

It does not say everything everything. For instance, it doesn't mention the words "please" and "thank you" that I, like any self respecting person, would expect of some stranger on the internet asking me to add such a complex feature to a project of mine, for free, as opposed to some one liner without even a hint of punctuation that was coughed up in barely a few seconds of thought.

But yeah. egui support is something I am interested in providing eventually, though it is going to be quite a complex undertaking.

@Alleexxi
Copy link
Author

Sorry, its just almost every issue i see/read is something like i wrote. So i though thats how u "write" issue's. Sorry if that doesn't make sense. I would really appreciate egui support because i like the design/look of it more than imgui.

@veeenu
Copy link
Owner

veeenu commented Aug 11, 2022

It's cool. I'm not sure how other maintainers feel about that in general, but courtesy and kindness are a hard boundary for me.

Regardless of how other people behave, if I may offer a piece of advice: kindness will always go a long way, because when you write anywhere on the internet it's always real people who will read you, and all other things being equal, people always prefer to be treated kindly.

egui does indeed look good and has the added value of being pure Rust. It's not the first time I consider it.

We will have to build 6 units of code, so to speak; 3 egui renderers (dx9, dx11, dx12) and one hook for each of those. Most of the code could be shared with the current imgui implementations but it'll still take a bit of testing and experimentation.

@Alleexxi
Copy link
Author

Alleexxi commented Aug 11, 2022

i would try to make it support egui myself. but i am too stupid to get the example to work

Edit:
when i try to build the hookyou example it give me a error

error[E0603]: struct ImguiRenderLoopFlags is private
--> src\lib.rs:6:45
|
6 | use hudhook::hooks::dx11::{ImguiRenderLoop, ImguiRenderLoopFlags};
| ^^^^^^^^^^^^^^^^^^^^ private struct
|

Edit 2:
sorry if this is offtopic

@etra0
Copy link
Contributor

etra0 commented Aug 11, 2022

Although egui seems interesting, I'd say it'd be out of the scope of this project since it heavily relies on imgui general behavior. It would involve either writing specific wrappers (as @veeenu said) or trying to write a more 'generic' code that at the end of the day would hurt maintainability.

I'd love to see more options for hooking into games, but I'd prefer keeping this one as imgui only. Of course, that's just my view.

Maybe this repository would be a good template for starting another one with an egui implementation.

@veeenu
Copy link
Owner

veeenu commented Aug 11, 2022

I don't fully agree with that -- after all, the API surface that the three current hooks share and expose to the top level is relatively minimal and quite generic, and otoh each egui renderer would share a lot of code with imgui's, so keeping and maintaining everything together may be simpler than rewriting the same mechanisms elsewhere, as the core problems to support a rendering hook have already been solved, so to speak.

Besides, it is not necessary to abstract all the way and we can get away with breaking the library in a few top-level traits (i.e. imgui hooks with whatever renderer vs egui hooks with whatever renderer).

But yeah, in general this will require a modicum of careful and proper design.

Luckily Rust has a lot of mechanisms to ease a similar process, feature flags and the excellent module system being two great examples.

@veeenu
Copy link
Owner

veeenu commented Aug 12, 2022

Edit: when i try to build the hookyou example it give me a error

error[E0603]: struct ImguiRenderLoopFlags is private --> src\lib.rs:6:45 | 6 | use hudhook::hooks::dx11::{ImguiRenderLoop, ImguiRenderLoopFlags}; | ^^^^^^^^^^^^^^^^^^^^ private struct |

This is a genuine issue, I created #23 to track it.

@etra0
Copy link
Contributor

etra0 commented Mar 15, 2023

maybe relevant: https://github.com/sy1ntexx/egui-d3d11

@Jakobzs
Copy link
Contributor

Jakobzs commented Apr 24, 2023

maybe relevant: https://github.com/sy1ntexx/egui-d3d11

A few of these libraries has indeed started to appear. To me it seems like they sorta follow the same base.

They can be found here:
DirectX 9
DirectX 11
OpenGL 3

I definitely also agree that egui support could be very interesting to support here, especially given that egui is written purely in Rust, although I am unsure of what changes it’d require in hudhook.

@RubberDuckShobe
Copy link

hi! is this still planned?
also, i noticed #122 - does that PR already make it possible to implement egui outside of hudhook itself?

@veeenu
Copy link
Owner

veeenu commented Mar 26, 2024

There is active work being done on it, but the codebase is not in a state where abstracting things away altogether will be practical; no matter how you slice it, the task will result in a lot of added code so not sure how this will work out.

@luadebug
Copy link

luadebug commented Aug 6, 2024

OpenGL
DirectX11
Dunno maybe something of this can help as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants