aboutsummaryrefslogtreecommitdiff
path: root/subprojects/d2tk/pugl/pugl/detail/mac_gl.m
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/d2tk/pugl/pugl/detail/mac_gl.m')
-rw-r--r--subprojects/d2tk/pugl/pugl/detail/mac_gl.m20
1 files changed, 10 insertions, 10 deletions
diff --git a/subprojects/d2tk/pugl/pugl/detail/mac_gl.m b/subprojects/d2tk/pugl/pugl/detail/mac_gl.m
index eda4371..4bf6fc1 100644
--- a/subprojects/d2tk/pugl/pugl/detail/mac_gl.m
+++ b/subprojects/d2tk/pugl/pugl/detail/mac_gl.m
@@ -1,5 +1,5 @@
/*
- Copyright 2019-2020 David Robillard <http://drobilla.net>
+ Copyright 2019-2020 David Robillard <d@drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -15,28 +15,28 @@
*/
/**
- @file mac_gl.m OpenGL graphics backend for MacOS.
+ @file mac_gl.m
+ @brief OpenGL graphics backend for MacOS.
*/
#include "pugl/detail/implementation.h"
#include "pugl/detail/mac.h"
+#include "pugl/detail/stub.h"
#include "pugl/pugl_gl.h"
-#include "pugl/pugl_stub.h"
#ifndef __MAC_10_10
# define NSOpenGLProfileVersion4_1Core NSOpenGLProfileVersion3_2Core
#endif
@interface PuglOpenGLView : NSOpenGLView
+@end
+
+@implementation PuglOpenGLView
{
@public
PuglView* puglview;
}
-@end
-
-@implementation PuglOpenGLView
-
- (id) initWithFrame:(NSRect)frame
{
const bool compat = puglview->hints[PUGL_USE_COMPAT_PROFILE];
@@ -69,6 +69,8 @@
self = [super initWithFrame:frame];
}
+ [self setWantsBestResolutionOpenGLSurface:YES];
+
if (self) {
[[self openGLContext] makeCurrentContext];
[self reshape];
@@ -97,11 +99,9 @@ puglMacGlCreate(PuglView* view)
{
PuglInternals* impl = view->impl;
PuglOpenGLView* drawView = [PuglOpenGLView alloc];
- const NSRect rect = NSMakeRect(
- 0, 0, view->frame.width, view->frame.height);
drawView->puglview = view;
- [drawView initWithFrame:rect];
+ [drawView initWithFrame:[impl->wrapperView bounds]];
if (view->hints[PUGL_RESIZABLE]) {
[drawView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
} else {