-
Re: Basic event handling with core graphics
guymadison Dec 21, 2018 9:51 AM (in response to olafus)The correct way is to create a ObjC application with a NSOpenGLView then subclass that and grab all its events like mouseDown / mouseUp. (https://developer.apple.com/documentation/appkit/nsopenglview)
You can do what you propose, thats kind of what AGL does at a much lower level but all of these API's are deprecated...
Start with Metal (https://www.clientresourcesinc.com/2018/04/30/rendering-graphics-with-metalkit-swift-4-part-1/)
You don't need to do all that controller crap but just get the basics in place and work from your sub-classed MetalView
FYI, there is no longer an equivelent to fullscreen in OS X its just a fullscreen window.
Here are all the NSView routines you need to subclass.
- (void) mouseDown:(NSEvent *)event
{
}
- (void) mouseDragged:(NSEvent *)event
{
}
- (void) mouseUp:(NSEvent *)event
{
}
- (void) mouseMoved:(NSEvent *)event
{
}
- (void) mouseEntered:(NSEvent *)event
{
}
- (void) mouseExited:(NSEvent *)event
{
}
- (void) rightMouseDragged:(NSEvent *)event
{
}
- (void) rightMouseUp:(NSEvent *)event
{
}
- (void) otherMouseDown:(NSEvent *)event
{
}
- (void) otherMouseDragged:(NSEvent *)event
{
}
- (void) otherMouseUp:(NSEvent *)event
{
}
- (void) scrollWheel:(NSEvent *)event
{
}
- (void) keyDown:(NSEvent *)event
{
}
- (void) keyUp:(NSEvent *)event
{
}
-
Re: Basic event handling with core graphics
olafus Jan 11, 2019 10:25 AM (in response to guymadison)thank you very much
-