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

OSX examples/bindings: help/maintainers wanted #1873

Closed
6 of 8 tasks
ocornut opened this issue Jun 11, 2018 · 5 comments
Closed
6 of 8 tasks

OSX examples/bindings: help/maintainers wanted #1873

ocornut opened this issue Jun 11, 2018 · 5 comments

Comments

@ocornut
Copy link
Owner

ocornut commented Jun 11, 2018

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

  • Does the design looks alright to you?
  • Missing: Clipboard is not supported.
  • Missing: Mouse cursors shapes are not supported.
  • We need to test a combination with imgui_impl_opengl3.cpp. We used the simpler imgui_impl_opengl2.cpp because of an issue related to the OpenGL loader. Could imgui_impl_opengl3 be fixed to work in the OSX ecosystem? (perhaps it doesn't need any loader there?) and a example_osx_opengl3/ demo app created accordingly.
  • Improve hi dpi support.
  • The elephant in the room is obviously that OpenGL is now considered obsolete on OSX. So ideally we'd aim at adding a imgui_impl_metal piece of code that provided the rendering aspect of it.
  • Keyboard is completely broken.
    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?
  • Missing: Support for multi-viewport (current branch is based on Master, not on the Viewport branch).

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!

@ocornut
Copy link
Owner Author

ocornut commented Jul 2, 2018

Work in progress Metal example/renderer there:
https://github.com/warrenm/imgui/tree/metal

ocornut added a commit that referenced this issue Jul 4, 2018
…rame position which has been moved recently master. (#1873)
warrenm added a commit to warrenm/imgui that referenced this issue Jul 5, 2018
…strating usage of Metal on macOS and iOS (partially addresses ocornut#1873)
@ocornut
Copy link
Owner Author

ocornut commented Jul 8, 2018

Still missing from imgui_impl_osx.mm: support for mouse cursor shape and visibility.

ocornut added a commit that referenced this issue Aug 8, 2018
)

Not modifying the main.cpp yet because we need to test GL ES 3 context creation on iOS (only imgui_impl_opengl3.cpp was tested).
ocornut added a commit that referenced this issue Aug 9, 2018
… on Android. Default on "#version 300 es" on ES 3. (#2002, #1873)
@ocornut
Copy link
Owner Author

ocornut commented Sep 30, 2020

The example_apple_metal/ and example_apple_opengl2/ are:

  • Missing cleanup code (context destruction)
  • Inconsistent with each others in term of structure. I would suggest transitioning toward more like example_apple_opengl2/ is doing aka less off-topic code. Ideally they'll mirror each other as much as possible.

Could somebody familiar with OSX/iOS help with those?

@ocornut
Copy link
Owner Author

ocornut commented Jun 28, 2021

88f4c13 tries to make both Metal and OpenGL2 example more similar but there are still a bunch of larger difference that we aren't familiar with. Would be nice is someone OSX/iOS friendly could decide how/if we should bridge the differences.

ocornut pushed a commit that referenced this issue Dec 13, 2021
…mouse cursor shape unconditionally. (#4759, #4253, #1873)

Note the original FIXME: refered to GLFWs Cocoa implementation, which is largely what this commit provides.
@ocornut
Copy link
Owner Author

ocornut commented May 13, 2024

Closing this as being an old general catchall issue.
The big remaining issues is more general better hidpi support across all platform, which has its own OSX specifities but there are more than enough dedicated issues already :)

@ocornut ocornut closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant