Hello,
As part of the work mentioned in #1870 I have pushed a first pass of refactored examples to Master.
While the changes are fairly consequent it shouldn't really affect users directly as your existing bindings/code will still work.
The core idea behind this refactor that we are separating the example "Platform code" (inputs, windowing, time) from the example "Renderer code" (directx, opengl, vulkan..). This separation has various advantage, but in particular become more important and valuable as we move toward the Viewport feature, which puts more responsibility on the Platform code. Another benefit is that framework like GLFW today don't support all the features we need for multi-viewport, and although the suggestions are being pushed to GLFW, having a fallback native path would be useful, as one of the top priority in the upcoming few months will be to get multi-viewport good enough to be in master.
I have now added an OSX branch https://github.com/ocornut/imgui/tree/osx, based on old work by @Pagghiu (#281) which we reworked with @itamago.
It consist mostly in:
examples/imgui_impl_osx.mm
examples/imgui_impl_osx.h
examples/example_osx_opengl2/main.cpp
The main.cpp app basically combines imgui_impl_osx.mm + imgui_impl_opengl2.cpp into a demo app.
Pretty simple stuff, no surprise. But since it is difficult for to make sensible progress on the Mac side, I would rather open a thread here.
Todo / Notes / If you want to help
EDIT In addition, I think we could later rework or dismantle the current example_apple/ folder which contains a bunch of odd cruft. I don't mind providing an example that include Synergy but the support code could probably be moved in libs/. Any suggestion on what to do with example_apple/ would be useful too.
Thanks!
Hello,
As part of the work mentioned in #1870 I have pushed a first pass of refactored examples to Master.
While the changes are fairly consequent it shouldn't really affect users directly as your existing bindings/code will still work.
The core idea behind this refactor that we are separating the example "Platform code" (inputs, windowing, time) from the example "Renderer code" (directx, opengl, vulkan..). This separation has various advantage, but in particular become more important and valuable as we move toward the Viewport feature, which puts more responsibility on the Platform code. Another benefit is that framework like GLFW today don't support all the features we need for multi-viewport, and although the suggestions are being pushed to GLFW, having a fallback native path would be useful, as one of the top priority in the upcoming few months will be to get multi-viewport good enough to be in master.
I have now added an OSX branch https://github.com/ocornut/imgui/tree/osx, based on old work by @Pagghiu (#281) which we reworked with @itamago.
It consist mostly in:
The
main.cppapp basically combines imgui_impl_osx.mm + imgui_impl_opengl2.cpp into a demo app.Pretty simple stuff, no surprise. But since it is difficult for to make sensible progress on the Mac side, I would rather open a thread here.
Todo / Notes / If you want to help
The keyboard mapping code is a little odd, which comes from the fact (and this is smart) that the keyboard events are covering both characters and keys (https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/HandlingKeyEvents/HandlingKeyEvents.html#//apple_ref/doc/uid/10000060i-CH7) by taking advantage of 0xF700 Unicode ranges for key. This doesn't fit super well with imgui's simplified approach. Any suggestion on how to improve that? Does it means that OSX doesn't have a concept of Keys? The current code maps 'a' to ImGuiKey_A but would a 'A' input work? Any suggestion/improvement?EDIT In addition, I think we could later rework or dismantle the current example_apple/ folder which contains a bunch of odd cruft. I don't mind providing an example that include Synergy but the support code could probably be moved in libs/. Any suggestion on what to do with example_apple/ would be useful too.
Thanks!