more clearly indicate target FPS as relates to display link

This commit is contained in:
Justin R. Miller
2015-11-04 09:57:33 -08:00
parent af758abf0f
commit 3bab2ad7d6

View File

@@ -53,6 +53,7 @@ const CGFloat MGLMinimumPitch = 0;
const CGFloat MGLMaximumPitch = 60;
const CLLocationDegrees MGLAngularFieldOfView = M_PI / 6.;
const std::string spritePrefix = "com.mapbox.sprites.";
const NSUInteger MGLTargetFPS = 30;
NSString *const MGLAnnotationIDKey = @"MGLAnnotationIDKey";
NSString *const MGLAnnotationSymbolKey = @"MGLAnnotationSymbolKey";
@@ -231,7 +232,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
// setup refresh driver
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateFromDisplayLink)];
_displayLink.frameInterval = 2;
_displayLink.frameInterval = 60 / MGLTargetFPS;
[_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
_needsDisplayRefresh = YES;