-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Recent big changes (1.60 WIP): CreateContext() required + Navigation Beta available #1599
Comments
Do you have any vision or direction for the auto-testing suite? That's something I would like to help out with, as I could kill two birds with one stone (learn APIs while also contributing to the project). |
@gerryhernandez The only things are the rough ideas written down in the old thread #435 (which was left abandoned, my bad). I think at the time I was mostly focusing on visual/documentation, whereas today I would put more focus on the testing aspect of it. Let's move over that topic. |
Thank you for the update! <3 |
Congratulations for your big work :-) Now, reading (e.g.) the last Windowmaker changes, I'm a little confused : does ImGui slowly become sort of window manager OpenGL / DirectX based , but more powerfull (several backends, and so on) ? e.g., reading http://repo.or.cz/wmaker-crm.git/blob/HEAD:/NEWS I see a lot of similarities (I previously read Sawfish code too, and I had this feeling). But maybe there is something important I did not understand. Complementary link (in french) : https://fr.wikipedia.org/wiki/Window_Maker |
Not sure I understand nor how to answer the question. Dear ImGui wants to empower developers to create tools, and it'll improve toward that goal. It's a very different goal than WindowMaker, even though there is a small amount of overlap in sort the things they need to do. There was always a little bit of "window management" inside imgui since you can move windows around, in essence imgui is its own window manager within your app. |
…cs engine render function after ImGui::Render(). Use ImGui::GetDrawData() to retrieve the ImDrawData* to display..(#1599) Examples: Updated examples.
Closing this informational topic now (it is being linked from 1.60 release notes) |
Thanks for making all this stuff! By the way, currently you have this in comments (in imgui.h):
Shouldn't Circle and Cross be switched? |
Correct, I'll fix the comment note. That that A/B are on different side on the Xbox and Switch controller. |
Yes, I fully agree with "A" and "B" differences on Switch and Xbox. :) |
Two things have made it into master today:
The first change is relatively small but will break your code until you call
CreateContext()
. This motivated me to bump the version number from 1.54 WIP to 1.60 WIP.Context Creation
If you are not using multiple contexts or reassigning allocators, you still need to make 2 small changes:
- You will need to call
ImGui::CreateContext()
once before using ImGui.Similarly you probably want to call
ImGui::DestroyContext()
at the end of your application.- There was a function
ImGui::Shutdown()
that the sample code in imgui_impl_xxx.cpp were calling. This function doesn't exist any more. You need to remove this line from your old copy of imgui_imgul_xxx.cpp, or update your copy of it. This is being replaced byDestroyContext
and it isn't the job of imgui_impl_xxx to make that call.If you are using multiple contexts, see #1565 for more details.
Memory Allocators
If you are reassigning memory allocators. The allocators are now global and not stored on a per-context basis, which was causing too much trouble. You can call
ImGui::SetAllocatorFunctions()
if you need to override them (they default to malloc/free).Keyboard Navigation
You can enable Beta keyboard navigation by setting:
io.NavFlags |= ImGuiNavFlags_EnableKeyboard
.Note that a new ImGuiKey enum
ImGuiKey_Space
was added that didn't exist before and you need to map it to use keyboard navigation. e.g.If you enable keyboard navigation but haven't set up this new key, NewFrame() will assert as a reminder.
If your code used a copy of the imgui_impl_xxx bindings it will be a good occasion to update them.
If your code used its own input binding you'll need to update that if you want to use keyboard navigation. Keyboard navigation is still in beta, you may post feedback/issue in #787.
With keyboard navigation you can use/activate most of dear imgui features from the keyboard:
It took a crazy amount of work to get this working nicely with the imgui paradigm and with the fact that dear imgui has little restriction on e.g the contents of menus, or the ability of lay out multiple items on one line, not mentioning that we don't have a fully retained understand of the UI. This is not a standard OS keyboard navigation scheme because the application you build with imgui are not following standard scheme. So it may be odd, incomplete and will definitively have issues, but we'll work through them over time.
Gamepad Navigation
You can enable Beta gamepad navigation by setting:
io.NavFlags |= ImGuiNavFlags_EnableGamepad
.And fill the
io.NavInputs[]
array.Here's some handy pictures depicting the controls for common controllers:
Edit Added images + PSD link
https://drive.google.com/drive/folders/1k4328OV-w20pWZfNcfpH0UoxHHQRkbQi
Gamepad navigation is still in beta, you may post feedback/issue in #787.
Rendering
This is not a new change but I feel the need to reiterate that you don't need to set a render function in
io.RenderDrawListsFn
any more (that function was then automatically called byImGui::Render()
). Instead you can callImDrawData* ImGui::GetDrawData()
to obtain a pointer to the stuff to content and pass that around as you wish. So there's no more callback involved which is more flexible.So technically
io.RenderDrawListsFn
is going to eventually be obsoleted (maybe in imgui 2.0) because it's less flexible. I'll update the example applications to useGetDrawData()
soon.Styles
Still will be revamped. In the meanwhile I have added 3 helpers functions to call in default styles:
StyleColorsClassic()
,StyleColorsDark()
,StyleColorsLight()
. I also changed the examples application to call itStyleColorsDark()
by default to make the default 1.60 experience better.What next?
EDIT
When you update always check out the API BREAKING CHANGES section at the top of imgui.cpp. Changes that may affect codebases/behavior should be listed here.
The text was updated successfully, but these errors were encountered: