-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Introduced a new Metal renderer implementation and a new example illustrating usage of Metal on macOS and iOS #1929
Conversation
…strating usage of Metal on macOS and iOS (partially addresses ocornut#1873)
I can't be more excited to see this, great! But is there a cpp way to call these codes? Is it only possible to use this binding with ObjC? Could you please provide a cpp example? |
I'm not sure I can see the motivation for making it C++-callable, since you have to provide references to Metal objects to use the renderer at all, and Metal is an Objective-C framework. Making the renderer API compatible with C++ would mean either removing type-safety or cluttering the interface for a vanishingly small number of use cases. Am I missing something? |
Thank you @warrenm for your work, much appreciated and super useful :) I've tested and merged this now (doesn't show up as merged here because I went through a intermediary branch to apply some minor changes to the documentation). I've also fixed the example_osx_opengl2/ code to pass in the view, and renamed it to (I've also nuked the old example_apple/ out of orbit, it wasn't maintained and the combination of both new examples are enough of a replacement. The only extra thing example_apple/ did was to integrate uSynergy but this is not a strict requirement for the demo and made it messier. I wouldn't mind adding a Synergy demo back in a neater way if in the future we'll support Android+iOS demos more thoroughly.) (In the future we should improve the DPI situation #1676, at least at a first step start tweaking our demo across all platforms, to rasterize the default font at double size on high-dpi settings).. |
As requested, I paste a message related to the macOS example.
The configuration of my computer is the following: macOS 10.12.6, Xcode 9.2 (9C40b), ImGui 1.63 WIP. I cannot upgrade to Xcode 9.3 or Xcode 9.4 because this is reserved for macOS 10.13 and later. |
@Alzathar Just change the version code |
Hello @buf1024 , @Alzathar, I would like to get this patched ideally. Is there a purpose to the Thank you! |
Downgrading Xcode projects can be tricky, but I'll take a look! If/when I get it fixed on a branch, I assume you'd want a PR for upstream? Update: Addressed by #2133 |
Thank you @warrenm . I also also applied this change to the opengl example. @Alzathar @buf1024 It is fixed for you now? Should "change the deployment target to 10.12" be something done in the project file, is "comment out the unnecessary included file" required on your end? If the class is not referenced we could remove the include as well. Thanks all! |
@ocornut Unfortunately the commit 745f010 is not enough. I had to do the supplementary things recommended by @buf1024:
It works like a charm after under macOS. On the other hand, I got a crash for the iOS example as reported in the following screenshot. I used the Simulator version 10.0 with the iPhone 8+ and iOS 11.2. |
Could you push a PR for both projects, and maybe users of newer XCode can confirm if it still works for them?
A quick Google search suggests that the Simulator doesn't support Metal. |
Done in the PR #2134. |
Partially addresses #1873