summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx-objc.mm
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-04-02 12:27:34 -0700
committerGraham Linden <graham@lindenlab.com>2019-04-02 12:27:34 -0700
commitd78ed764b538cf0fa0eba3e39fbbf99ef059660a (patch)
tree5f19fcdd4826e15c39ca70f3f6b3a7aee22e4a69 /indra/llwindow/llwindowmacosx-objc.mm
parent14629ca3d661c8ec798ad072c4e739571d9c1196 (diff)
parent5cf18cb867be567bf921f0b94a78fd822e4112ad (diff)
Merge 6.1.2 LoveMeRender new hotness
Diffstat (limited to 'indra/llwindow/llwindowmacosx-objc.mm')
-rw-r--r--indra/llwindow/llwindowmacosx-objc.mm24
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)