fixes for mac
This commit is contained in:
@@ -194,18 +194,31 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
|
||||
}
|
||||
- (void)mouseDown:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
App::I.mouse_down(0, mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)mouseUp:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
App::I.mouse_up(0, mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)mouseMoved:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
-(void)mouseDragged:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -257,7 +270,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
|
||||
|
||||
auto style = NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask;
|
||||
window = [[Window alloc] initWithContentRect:r styleMask:style backing:NSBackingStoreBuffered defer:NO];
|
||||
[window setTitle:@"hello engine - ui shapes"];
|
||||
[window setTitle:@"PanoPainter 0.1.2 alpha"];
|
||||
[window center];
|
||||
[window makeKeyAndOrderFront:controller];
|
||||
[window setContentView:view];
|
||||
|
||||
Reference in New Issue
Block a user