diff -ru glut-3.3.2-orig/GLUTView.h glut-3.3.2-work/GLUTView.h
--- glut-3.3.2-orig/GLUTView.h	2008-02-08 19:47:22.000000000 +0100
+++ glut-3.3.2-work/GLUTView.h	2015-03-23 11:00:50.000000000 +0100
@@ -131,6 +131,7 @@
 - (void)setEventMask: (int)mask;
 - (BOOL)isFullscreenStereo;
 - (BOOL)isVBLSync;
+- (int)windowScale;
 
 /* Callbacks */
 - (void)setKeyDownCallback: (GLUTkeyboardCB)func;
diff -ru glut-3.3.2-orig/GLUTView.m glut-3.3.2-work/GLUTView.m
--- glut-3.3.2-orig/GLUTView.m	2015-03-23 11:22:19.000000000 +0100
+++ glut-3.3.2-work/GLUTView.m	2015-03-23 11:08:24.000000000 +0100
@@ -9,6 +9,16 @@
 #import "GLUTWindow.h"
 #import "GLUTMenu.h"
 
+// HiDPI support
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+
+@interface NSView (HiDPI)
+- (void)setWantsBestResolutionOpenGLSurface:(BOOL)aBool;
+- (BOOL)wantsBestResolutionOpenGLSurface;
+@end
+
+#endif
+
 
 @interface GLUTView(GLUTPrivate)
 - (void)_commonReshape;
@@ -37,6 +47,11 @@
 		 fullscreenStereo: (BOOL)pfStereo isVBLSynced: (BOOL)isVBLSync
 {	
    if((self = [super initWithFrame: frameRect]) != nil) {
+      if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
+         if(__glutDisplayString) {
+            [self setWantsBestResolutionOpenGLSurface:(strstr(__glutDisplayString, "hidpi") != NULL)];
+         }
+      }
    
       _openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
       if(!_openGLContext) {
@@ -297,7 +312,7 @@
 	/* Return window size in local coordinates. */
 - (NSSize)windowSize
 {
-   return [self bounds].size;
+   return [self convertSizeToBacking: [self bounds].size];
 }
 
 - (int)visibilityState
@@ -391,6 +406,10 @@
    return _isVBLSync;
 }
 
+- (int)windowScale
+{
+   return [self windowSize].width / [self bounds].size.width;
+}
 
 /////////////////////////////////////////////
 #pragma mark -
@@ -972,6 +991,7 @@
          if(event->desiredConfMask & (CWWidth | CWHeight)) {
             /* resize window */
             NSSize	Xsize = NSMakeSize(event->desiredWidth, event->desiredHeight);
+            Xsize = [self convertSizeFromBacking: Xsize];
             NSMutableSet *	views = [NSMutableSet set];
             
             [views unionSet: [self coveredViews]];
@@ -1133,7 +1153,7 @@
 
 - (void)_commonReshape
 {
-   NSSize	size = [self bounds].size;
+   NSSize	size = [self windowSize];
    
    __glutSetWindow(self);
    (*_reshapeFunc)(size.width, size.height);
@@ -1520,6 +1540,14 @@
    return YES;
 }
 
+- (NSPoint)convertMouseLocationToBacking: (NSPoint)mouseLocation
+{
+   NSPoint point = [self convertPoint: mouseLocation fromView: nil];
+   point = [self convertPointToBacking: point];
+   point.y = -point.y;
+   return point;
+}
+
 /* Key up/down & special up/down */
 - (void)keyDown: (NSEvent *)theEvent
 {
@@ -1531,7 +1559,7 @@
    if(_flags.ignoreKeyRepeats && [theEvent isARepeat])
       return;
    
-   loc = [self convertPoint: [[self window] mouseLocationOutsideOfEventStream] fromView: nil];
+   loc = [self convertMouseLocationToBacking: [[self window] mouseLocationOutsideOfEventStream]];
    _iMouseLocX = rint(loc.x);
    _iMouseLocY = rint(loc.y);
    __glutModifierMask = [theEvent modifierFlags];
@@ -1592,7 +1620,7 @@
          // Only send in events where this isn't a duplicate mouse down (emulation)
          // This way we can maintain a 1 to 1 up/down ratio
          if( !(_flags.hadMouseDown & (1 << buttonID)) ) {
-            NSPoint location = [self convertPoint: [theEvent locationInWindow] fromView: nil];
+            NSPoint location = [self convertMouseLocationToBacking: [theEvent locationInWindow]];
 
             __glutSetWindow(self);
             (*_mouseFunc)(buttonID, GLUT_DOWN, rint(location.x), rint(location.y));
@@ -1615,7 +1643,7 @@
       clicking *outside* of the pop-up menu. Such mouse up events should
       not be passed to the GLUT app. */
    if(_mouseFunc) {
-      NSPoint	location = [self convertPoint: [theEvent locationInWindow] fromView: nil];
+      NSPoint	location = [self convertMouseLocationToBacking: [theEvent locationInWindow]];
       int		buttonID, buttonPhysID;
       
       __glutMapMouseButton(theEvent, &buttonID, &buttonPhysID, &__glutModifierMask);
@@ -1652,7 +1680,7 @@
 - (void)_commonMouseDragged: (NSEvent *)theEvent
 {
    if([theEvent buttonNumber] <= 2 && _motionFunc) {
-      NSPoint	location  = [self convertPoint: [theEvent locationInWindow] fromView: nil];
+      NSPoint	location  = [self convertMouseLocationToBacking: [theEvent locationInWindow]];
       
       __glutSetWindow(self);
       (*_motionFunc)(rint(location.x), rint(location.y));
@@ -1692,6 +1720,7 @@
       }
    }
    
+   location = [self convertMouseLocationToBacking: [theEvent locationInWindow]];
    if(_passiveMotionFunc) {
       __glutSetWindow(self);
       (*_passiveMotionFunc)(rint(location.x), rint(location.y));
@@ -1771,7 +1800,7 @@
 {
    __glutModifierMask = [theEvent modifierFlags];
    if(_mouseFunc) {
-      NSPoint location = [self convertPoint: [theEvent locationInWindow] fromView: nil];
+      NSPoint location = [self convertMouseLocationToBacking: [theEvent locationInWindow]];
       
       int x = rint(location.x);
       int y = rint(location.y);
diff -ru glut-3.3.2-orig/GLUTWindow.m glut-3.3.2-work/GLUTWindow.m
--- glut-3.3.2-orig/GLUTWindow.m	2015-03-23 10:58:48.000000000 +0100
+++ glut-3.3.2-work/GLUTWindow.m	2015-03-23 11:09:30.000000000 +0100
@@ -105,7 +105,12 @@
                               treatAsSingle: treatAsSingle
                               isSubwindow: NO
                               fullscreenStereo:pfStereo 
-							  isVBLSynced: __glutSyncToVBL] autorelease];
+                              isVBLSynced: __glutSyncToVBL] autorelease];
+   if([view respondsToSelector:@selector(wantsBestResolutionOpenGLSurface)]) {
+      if([view wantsBestResolutionOpenGLSurface]) {
+         rect = [view convertRectFromBacking: rect];
+      }
+   }
    if(view)
       return [self _initWithContentRect: rect styleMask: mask contentView: view];
    else
@@ -672,4 +677,19 @@
    }
 }
 
+- (void)windowDidChangeBackingProperties:(NSNotification *)notification {
+    CGFloat oldBackingScaleFactor = [[[notification userInfo]
+         objectForKey:@"NSBackingPropertyOldScaleFactorKey"]
+         doubleValue];
+    CGFloat newBackingScaleFactor = [self backingScaleFactor];
+    CGFloat ratio = oldBackingScaleFactor/newBackingScaleFactor;
+    NSRect frame = self.frame;
+    NSRect bounds = [self.contentView bounds];
+    frame.size.width  += bounds.size.width *(ratio-1);
+    frame.size.height += bounds.size.height*(ratio-1);
+    frame.origin.y -= bounds.size.height*(ratio-1)/2;
+    frame.origin.x -= bounds.size.width*(ratio-1)/2;
+    [self setFrame: frame display: YES];
+}
+
 @end
diff -ru glut-3.3.2-orig/glut.h glut-3.3.2-work/glut.h
--- glut-3.3.2-orig/glut.h	2015-03-23 11:00:11.000000000 +0100
+++ glut-3.3.2-work/glut.h	2015-03-23 11:09:51.000000000 +0100
@@ -316,6 +316,7 @@
 #if (GLUT_API_VERSION >= 3)
 #define GLUT_WINDOW_CURSOR		122
 #endif
+#define GLUT_WINDOW_SCALE		199
 #define GLUT_SCREEN_WIDTH		200
 #define GLUT_SCREEN_HEIGHT		201
 #define GLUT_SCREEN_WIDTH_MM		202
diff -ru glut-3.3.2-orig/macx_dstr.m glut-3.3.2-work/macx_dstr.m
--- glut-3.3.2-orig/macx_dstr.m	2008-02-08 19:47:22.000000000 +0100
+++ glut-3.3.2-work/macx_dstr.m	2015-03-23 11:10:08.000000000 +0100
@@ -521,6 +521,11 @@
             return 1;
          }
          return -1;
+      case 'h':
+         if (!strcmp(word, "hidpi")) {
+            return 1;
+         }
+         return -1;
       case 'i':
          if (!strcmp(word, "index")) {
             criterion[0].capability = RGBA;
diff -ru glut-3.3.2-orig/macx_get.m glut-3.3.2-work/macx_get.m
--- glut-3.3.2-orig/macx_get.m	2008-02-08 19:47:22.000000000 +0100
+++ glut-3.3.2-work/macx_get.m	2015-03-23 11:10:17.000000000 +0100
@@ -140,6 +140,9 @@
   		case GLUT_WINDOW_CURSOR:
  			ival = [__glutCurrentView cursor];
           break;
+  		case GLUT_WINDOW_SCALE:
+ 			ival = (int) [__glutCurrentView windowScale];
+          break;
   		case GLUT_SCREEN_WIDTH:
  			ival = __glutScreenWidth;
           break;
