Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey, I've been trying to implement OIS into my emulator but for reasons I haven't determined yet, it isn't working. Might have another patch for that in the near future when I figure it out.
While digging around in the codebase I learned that the demos barely supported macos so I took a quick stab at fixing them.
The FFDemo just need cocoa to be implemented but the ConsoleDemo was the interesting one.
ReceiveNextEvent
was actually returning an error-9874
which according to https://www.osstatus.com/ iseventNotHandledErr
which explains why the rest of the demo was non-functional.I assume that the carbon Api's became fully incompatible with Cocoa Objects on an older version of MacOS(I'm on sonoma). So i switched over to the cocoa versions of these functions. Custom event loops like this are not really recommended for Cocoa Apps for several reasons but I don't think any are relevant to this example.
I took some inspiration from wxWidgets for the implementation. you can read more about it here:
https://github.com/wxWidgets/wxWidgets/blob/19aee81c1deb876e965661fd902565615a6a09f3/src/osx/cocoa/evtloop.mm
and here:
https://www.cocoawithlove.com/2009/01/demystifying-nsapplication-by.html
If you think we should instead be a little bit more supportive of Native Cocoa App Architecture then I'll probably need to do it in another PR and it would take some refactors to the demos to accomplish. Just let me know.
closes #35