-
Notifications
You must be signed in to change notification settings - Fork 361
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
Feature: wxWidgets-based editors. #647
Conversation
- trying my hand at migrating from MFC to wxWidgets - PDA editor ported - Windows-only for now, but cross-platform support is definitely planned - need to manually export fbp (wxFormBuilder project) to xrc file, and then manually invoke `wxrc /c --output PDAEditor_xmlresource.cpp PDAEditor.xrc` - not sure if `CMakePresets.json` are needed - no idea what is `doom.aps`
Interesting! :) I converted it to a draft PR because it obviously is still pretty far from ready.
|
BTW, out of interest, why wxWidgets and not another crossplatform toolkit (like Qt or Dear ImGui)? |
if i have to guess is because its almost like MFC in terms of usage, and there is an official guide that gives a step by step tips to migrate from MFC to wxWidgets (QT has this buts is like an abandone project from 14 years ago |
Indeed, I found a very detailed guide on porting from MFC to wxWidgets. I also have some experience with WPF and Avalonia, but they would be difficult to use with the current architecture. I was thinking about ImGui too but it's probably going to need more restructuring? I have no experience with immediate UIs. |
Thanks! Just wanted to get a quick feedback.
I can test it on Windows & Linux. I have an older Mac too, but I want to start with the Windows side, and the move on from there. Is this a reasonable approach? I don't have much experience setting up Mac for development.
What is AROS? I got confused there. I wanted to add wxWidgets code as a separate library, and then it could be linked into the executable. I think that as I move forward, I'll have less and less MFC code, and more wxWidgets code, so in the end things should become much simpler to port to Linux & Mac.
Thanks. I'll remove it. I had a lot of issues trying to integrate wxWidgets into the engine (the FindWxWidgets macro is trying to hijack CXX flags for some reason!). The other approach would be to compile it from source.
It could be I think. I didn't come around a sample though, so just left it as-is for now.
What are the more interesting editors? I'm currently going over the script editor. I'm trying to go roughly in the order of smaller to larger effort. |
other interesting ones is
|
Ok, I didn't know of such a guide, I only saw https://wiki.wxwidgets.org/WxWidgets_For_MFC_Programmers which seems to give some general suggestions (and links some IBM tutorial that's not available anymore). I wonder how similar MFC and Wx really are, because looking at the diff, it still seems to require lots of changes to the code. ImGui is also different from MFC, but IMO it's pretty simple to use. Ages ago I ported the Light Editor to Dear ImGui in a Doom 3 BFG-based project: https://github.com/OpenTechEngine/OpenTechBFG/blob/master/neo/tools/editors/LightEditor.cpp Anyway, while Dear ImGui clearly is different from MFC, I didn't have to completely rewrite the code. The code that uses MFC of course had to change, but the helper functions and classes (like LightInfo) only needed small adjustments, and of course the code interacting with the engine and its types (idVec3, idDict, idEntity, the idEditEntities interface) also stayed pretty much the same. |
That's ok, I don't have a Mac either. The automated builds from Github at least tell us if it still compiles, and if it works on Windows and Linux that should be a good enough start.
Some obscure operating system, don't worry about it
Sounds generally sensible, it would just be nice if there was a CMake option like |
@FriskTheFallenHuman Thanks for the heads-up!
I was talking about this and there's this talk by the same author.
Didn't know about this and thank you for bringing this up. In the end I just want the live coding ability for Dhewm 3 on my Linux box, ImGui would also work. The other thing we could try is separate out the UI part. The engine would expose some API (e.g. JSON-RPC), and it could react to commands sent by editors. Thoughts?
I'll try porting to ImGui, it's very light-weight. The only thing it's lacking is a source code editor: I wanted to have the ability to live code the scripts, seems like we'll have to use Scintilla for instance, or some such, or leave code editing to a separate tool. |
just a quick note about source code editor: there are third-party solutions for ImGui, for example https://github.com/BalazsJako/ImGuiColorTextEdit |
I don't really like it TBH.
Thanks! :) To support that I will start porting the light editor (and for that provide the general infrastructure to open ImGui editor/tool windows) today, maybe based on my imgui-docking branch. That branch uses the "docking" version of Dear ImGui, which (among other things) allows dragging ImGui windows (that usually are just rendered within dhewm3s window) out of the dhewm3 window, so they turn into separate windows. It's almost like magic ;) |
Point taken.
Great! I'll keep my branch against master for now, just to get the ball rolling, and we could coordinate this further when I submit a new PR with the proposed changes. |
Wow that was a fast reply :D See the update in my previous comment, I'd suggest starting with a ImGui sample application because it allows for faster iteration :) |
Ok, due to hitting a bug in the ImGui docking branch (it's fixed upstream now) this took a bit longer than expected, but here is my My imgui-docking branch is also updated (force-pushed) to that latest imgui code. |
@DanielGibson Thanks a ton! I'm almost done with the Dear Imgui version. I want to polish a few things before submitting a new PR. A few things I don't understand how to do properly:
A few things that would be good to have, but not critical:
|
Closing in favor of #649. |
wxrc /c --output PDAEditor_xmlresource.cpp PDAEditor.xrc
CMakePresets.json
are neededdoom.aps
Here's the result so far,
editPDAs
using the new dialog: