Indicate target frame interval, with a comment about how it relates to FPS.
This commit is contained in:
committed by
Justin R. Miller
parent
3bab2ad7d6
commit
b55bd85886
@@ -53,7 +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;
|
||||
const NSUInteger MGLTargetFrameInterval = 2; //Target FPS will be 60 divided by this value
|
||||
|
||||
NSString *const MGLAnnotationIDKey = @"MGLAnnotationIDKey";
|
||||
NSString *const MGLAnnotationSymbolKey = @"MGLAnnotationSymbolKey";
|
||||
@@ -232,7 +232,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
|
||||
|
||||
// setup refresh driver
|
||||
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateFromDisplayLink)];
|
||||
_displayLink.frameInterval = 60 / MGLTargetFPS;
|
||||
_displayLink.frameInterval = MGLTargetFrameInterval;
|
||||
[_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
|
||||
_needsDisplayRefresh = YES;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user