DisplayManager.h
1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include "UnityRendering.h"
#include "GlesHelper.h"
#include <UIKit/UIKit.h>
@class EAGLContext;
@class UnityView;
@interface DisplayConnection : NSObject
- (id)init:(UIScreen*)targetScreen;
- (void)dealloc;
- (void)createView:(BOOL)useForRendering showRightAway:(BOOL)showRightAway;
- (void)createView:(BOOL)useForRendering;
- (void)createWithWindow:(UIWindow*)window andView:(UIView*)view;
- (void)initRendering;
- (void)recreateSurface:(RenderingSurfaceParams)params;
- (void)destroySurface;
- (void)shouldShowWindow:(BOOL)show;
- (void)requestRenderingResolution:(CGSize)res;
- (void)present;
@property (readonly, copy, nonatomic) UIScreen* screen;
@property (readonly, copy, nonatomic) UIWindow* window;
@property (readonly, copy, nonatomic) UIView* view;
@property (readonly, nonatomic) CGSize screenSize;
@property (readonly, nonatomic) UnityDisplaySurfaceBase* surface;
@end
@interface DisplayManager : NSObject
- (id)objectForKeyedSubscript:(id)key;
- (BOOL)displayAvailable:(UIScreen*)targetScreen;
- (void)updateDisplayListCacheInUnity;
- (void)startFrameRendering;
- (void)present;
- (void)endFrameRendering;
- (void)enumerateDisplaysWithBlock:(void (^)(DisplayConnection* conn))block;
- (void)enumerateNonMainDisplaysWithBlock:(void (^)(DisplayConnection* conn))block;
+ (void)Initialize;
+ (DisplayManager*)Instance;
+ (void)Destroy;
@property (readonly, nonatomic) DisplayConnection* mainDisplay;
@property (readonly, nonatomic) NSUInteger displayCount;
@end
inline DisplayConnection* GetMainDisplay()
{
return [DisplayManager Instance].mainDisplay;
}
inline UnityDisplaySurfaceBase* GetMainDisplaySurface()
{
return GetMainDisplay().surface;
}