alaingalvan / CrossWindow

💻📱 A cross platform system abstraction library written in C++ for managing windows and performing OS tasks.
https://alain.xyz/libraries/crosswindow
MIT License
616 stars 50 forks source link

Unable to access CAMetalLayer with CocoaWindow due to protected layer property #25

Open fathonyfath opened 1 year ago

fathonyfath commented 1 year ago

According to the documentation for CrossWindow-Renderer, in order to access the underlying CAMetalLayer, we need to access the layer property. However, this property is marked as protected in CocoaWindow, which makes it impossible to use Metal with Cocoa. The relevant code can be found here: https://github.com/alaingalvan/CrossWindow/blob/3511e43d0bbdc5fd23b4717580cc47ad3df87e4c/src/CrossWindow/Cocoa/CocoaWindow.h#L48-L61

In contrast, the layer property is publicly accessible in UIKitWindow.