Files
MapLibreParticleLab/platform/darwin/src/MGLOpenGLStyleLayer.h
Jason Wray 3d3b87e020 [ios] Fix type narrowing issue with MGLOpenGLStyleLayer projection matrix (#11664)
`CATransform3D`'s matrix is internally typed as `CGFloat`, which we were implicitly casting to from `double`.... except that the `-Wc++11-narrowing` flag disallows implicit narrowing casts and we need `double` precision, anyway.

* [ios, macos] Use MGLMatrix4 a 4x4 double matrix for MGLOpenGLStyleLayer projection matrix.

* [ios, macos] Don't use union for MGLMatrix4
2018-04-16 19:17:37 -04:00

43 lines
970 B
Objective-C

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <QuartzCore/QuartzCore.h>
#import "MGLFoundation.h"
#import "MGLStyleValue.h"
#import "MGLStyleLayer.h"
#import "MGLGeometry.h"
NS_ASSUME_NONNULL_BEGIN
@class MGLMapView;
@class MGLStyle;
typedef struct MGLStyleLayerDrawingContext {
CGSize size;
CLLocationCoordinate2D centerCoordinate;
double zoomLevel;
CLLocationDirection direction;
CGFloat pitch;
CGFloat fieldOfView;
MGLMatrix4 projectionMatrix;
} MGLStyleLayerDrawingContext;
MGL_EXPORT
@interface MGLOpenGLStyleLayer : MGLStyleLayer
@property (nonatomic, weak, readonly) MGLStyle *style;
- (instancetype)initWithIdentifier:(NSString *)identifier;
- (void)didMoveToMapView:(MGLMapView *)mapView;
- (void)willMoveFromMapView:(MGLMapView *)mapView;
- (void)drawInMapView:(MGLMapView *)mapView withContext:(MGLStyleLayerDrawingContext)context;
- (void)setNeedsDisplay;
@end
NS_ASSUME_NONNULL_END