Being that it would be rather inconvenient to change the class from MTKView
to my own view, and override code to insert updateTrackingAreas()
code, just to detect mouse moved events, would it be OK to do it instead like this?
func mtkView(_ _: MTKView, drawableSizeWillChange Size: CGSize) {
if let TrackingArea = Area {
View.removeTrackingArea(TrackingArea)
}
Area = NSTrackingArea(rect: View.bounds, options: [.mouseEnteredAndExited, .mouseMoved, .activeInKeyWindow], owner: View, userInfo: nil)
View.addTrackingArea(Area!)
/*ProjectionMatrix = ProjectPerspective(Float(Size.width/Size.height))
View.draw()*/
}
Is there an even better way to implement tracking areas in a Metal game? (I hope so)
meh, just to be safe i decided to put them in updateTrackingAreas