summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx-objc.mm
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowmacosx-objc.mm')
-rw-r--r--indra/llwindow/llwindowmacosx-objc.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm
index 43ce9a2255..489f92fa14 100644
--- a/indra/llwindow/llwindowmacosx-objc.mm
+++ b/indra/llwindow/llwindowmacosx-objc.mm
@@ -253,6 +253,11 @@ unsigned long getVramSize(GLViewRef view)
return [(LLOpenGLView *)view getVramSize];
}
+float getDeviceUnitSize(GLViewRef view)
+{
+ return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width;
+}
+
void getContentViewBounds(NSWindowRef window, float* bounds)
{
bounds[0] = [[(LLNSWindow*)window contentView] bounds].origin.x;
@@ -261,6 +266,11 @@ void getContentViewBounds(NSWindowRef window, float* bounds)
bounds[3] = [[(LLNSWindow*)window contentView] bounds].size.height;
}
+const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view)
+{
+ return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size;
+}
+
void getWindowSize(NSWindowRef window, float* size)
{
NSRect frame = [(LLNSWindow*)window frame];