-
Notifications
You must be signed in to change notification settings - Fork 53
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
New desktop GUI using ImGui #583
Conversation
- glfw - imgui - glad
- modified main.cpp accordingly and applied some formatting - modified VFRendering for GLAD to work - basic functionality is working: opening a glfw window with some imgui content and drawing VFRendering arrows
The code should run, but it produces visually incorrect results - the GUI is not coloured correctly and the arrows are not drawn correctly.
The imgui now uses a separate webgl canvas placed on top of the VFRendering canvas. Also made some minor modifications to the gui contents.
- added contents to the overlay, split into system and calculation info - added a parameter-window that adapts to the selected method - added a keybindings window - added an about window - added more content to the menu bar
- starting and stopping calculations, selectable via the menu bar and the info-widget - handling mouse and keyboard via imgui instead of glfw - initialize vfr geometry etc from info out of spirit and update spins every time we draw - added initial plots
- added required pthread compile and link commands to be able to run simulation threads in the web UI (note: this currently only works in chromium-based browsers) - can now only build either the current ui-web or ui-imgui for web - added spirit.worker.js to gitignore - added favicon.ico - added a little exception-catching to print better errors on the web UI if they occur
Can control the background colour and the light direction, using the new gizmo3d.
- wrong #define used in VFRendering::View - missing include in main_web.cpp - missing simulation stop and thread join before closing window
- more bools in main_window instead of static - reordered widgets.hpp - some widgets windows can now be closed - overlays can now be also toggled with "i" key - improved scrolling behaviour on Apple - now handling ctrl/cmd difference on Apple
- renamed `main_window` -> `MainWindow`. - moved static variables from main_window.cpp into MainWindow class - moved show_menu_bar to MainWindow, since it is the main window menu bar - better toggles for windows, which can now also be closed by 'x'-button - more information added to "about"-window - renamed `loop` to `draw` - added drawing during resizing (unfortunately this is not yet smooth) - added `vfr_needs_redraw` and `vfr_needs_data` in order to save some CPU load
- moved usage of VFRendering into RenderingLayer class - added MainWindow functions for manipulating the chain - added indicator of chain length
- added res/Logo_Ghost.png as compiled resource in CMake - added `textures::load_from_file`, which uses the compiled resource files and loads a given file into an OpenGL texture - added logo to the "about"-window - also fixed missing rendering_layer.cpp in source list
The tooltip on the method selection is helpful to explain what the acronyms mean.
- removed `glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 )`, which would require webgl2 - also improved styles to reduce opacity of windows, which can have strange effects in the browser - also some formatting changes
- fixed application icon (at least for windows) - added stb_image_resize.h to thirdparty/stb - restructured textures.hpp/cpp and renamed to images.hpp/cpp - added Logo_Ghost_Final_Notext.png, which is now resized using stb_image_resize to generate glfw app icons in various sizes - improved "about window" formatting and logo size - replaced a lot of ImGui::Text with ImGui::TextUnformatted - removed AppIcon32.png and AppIcon128.png
The imgui web app has apparently been broken by commit 9becfa5. The bug is triggered by any calls to A solution might be to create a |
Now using ImGui's implementation of backends.
The main problem was that VFR options and renderers were being updated from within ImGui calls, while the active context was the one for the ImGui. This has been circumvented by adding all options updates to a deque that is worked off right before drawing. Also, the `emscripten_webgl_make_context_current( context_vfr )` call has been moved to right in front of the VFR draw. Furthermore, some shaders were not working reliably with WebGL: `const int` cannot be converted to `float` and the `f` postfix is not supported by OpenGL ES 2. Added some basicexception handling to `emscripten_loop`. Also - some fixes for the ImGui update. - some minor naming fixes. - minor update of main_web.cpp
62de706
to
4981481
Compare
Note: bf2bb6a, updating ImGui to v1.81, adds the tables feature. This could be used to display and allow to edit the exchange and DM interaction pairs. Since the desktop web app now (since 4981481) seems to work correctly, it would be a good time to add the mobile and desktop web apps to the list of CI artifacts. |
Note: there is still no getter for DMI pairs, only for the number of DMI pairs.
Note: DMI pairs are also "shown", but there is no content yet, as the API for that is still missing.
9ba8e99
to
c24a6c7
Compare
This applies mainly to the interaction modes. Not sure if an something was changed with an ImGui update, but the current solution using `io.MouseDrawCursor` did not seem to work correctly anymore.
I have added some basic documentation of the IM GUI usage and build process. |
Updated the build docs accordingly. Also made some minor fixes to Qt GUI docs.
Now automatically copies the current image when an increase of the chain length is requested. Also fixed a bug in ui-imgui that caused a crash when reducing the chain length
Closes #20.
Closes #68.
Closes #112.
Closes #119.
Closes #178.
Closes #213.
Closes #247.
Closes #401.
Closes #407.
Closes #448.
Closes #452.
Closes #473.
Closes #474.
Closes #546.
Related to issue #511.
Note: the API for setting the Hamiltonian at runtime has been implemented on the branch
fixed-imgui
.