diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-02 22:12:55 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-02 22:12:55 +0300 |
commit | 65bf63c973caa388c33dd02470b1cf4c818834e2 (patch) | |
tree | b66489b924a5418425fbffbc50d43bcb5916c7b4 /indra/llwindow/llwindowmacosx-objc.mm | |
parent | eb6a7cde9d08215f18b9b9c707f39f73b60403a8 (diff) | |
parent | 5cf18cb867be567bf921f0b94a78fd822e4112ad (diff) |
Merged in lindenlab/viewer-bear
Diffstat (limited to 'indra/llwindow/llwindowmacosx-objc.mm')
-rw-r--r-- | indra/llwindow/llwindowmacosx-objc.mm | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 43ce9a2255..c3eb9b8c8a 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -253,12 +253,24 @@ unsigned long getVramSize(GLViewRef view) return [(LLOpenGLView *)view getVramSize]; } -void getContentViewBounds(NSWindowRef window, float* bounds) +float getDeviceUnitSize(GLViewRef view) { - bounds[0] = [[(LLNSWindow*)window contentView] bounds].origin.x; - bounds[1] = [[(LLNSWindow*)window contentView] bounds].origin.y; - bounds[2] = [[(LLNSWindow*)window contentView] bounds].size.width; - bounds[3] = [[(LLNSWindow*)window contentView] bounds].size.height; + return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width; +} + +const CGPoint & getContentViewBoundsPosition(NSWindowRef window) +{ + return [[(LLNSWindow*)window contentView] bounds].origin; +} + +const CGSize & getContentViewBoundsSize(NSWindowRef window) +{ + return [[(LLNSWindow*)window contentView] bounds].size; +} + +const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view) +{ + return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size; } void getWindowSize(NSWindowRef window, float* size) @@ -368,8 +380,8 @@ void closeWindow(NSWindowRef window) void removeGLView(GLViewRef view) { + [(LLOpenGLView*)view clearGLContext]; [(LLOpenGLView*)view removeFromSuperview]; - [(LLOpenGLView*)view release]; } void setupInputWindow(NSWindowRef window, GLViewRef glview) |