curl timeout, reorder layers, handle right click osx
This commit is contained in:
@@ -61,8 +61,10 @@
|
||||
CVDisplayLinkStart(dl);
|
||||
|
||||
CGLEnable([self.openGLContext CGLContextObj], kCGLCECrashOnRemovedFunctions);
|
||||
|
||||
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
App::I.init();
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
|
||||
// This is the renderer output callback function
|
||||
@@ -91,6 +93,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
|
||||
// thread. Add a mutex around to avoid the threads accessing the context
|
||||
// simultaneously when resizing
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
App::I.clear();
|
||||
App::I.update(now - _prevTime);
|
||||
|
||||
//[[self openGLContext] flushBuffer];
|
||||
@@ -200,6 +203,13 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
|
||||
App::I.mouse_down(0, mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)rightMouseDown:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
App::I.mouse_down(1, mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)mouseUp:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
@@ -207,6 +217,13 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
|
||||
App::I.mouse_up(0, mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)rightMouseUp:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
App::I.mouse_up(1, mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)mouseMoved:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
@@ -221,6 +238,20 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
|
||||
App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
- (void)rightMouseDragged:(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)scrollWheel:(NSEvent *)theEvent
|
||||
{
|
||||
CGLLockContext([[self openGLContext] CGLContextObj]);
|
||||
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
App::I.mouse_scroll(mouseLoc.x, App::I.height - mouseLoc.y - 1, [theEvent deltaY]);
|
||||
CGLUnlockContext([[self openGLContext] CGLContextObj]);
|
||||
}
|
||||
@end
|
||||
|
||||
@interface Window : NSWindow
|
||||
|
||||
Reference in New Issue
Block a user