|
7 | 7 |
|
8 | 8 | #include "ofxiOSExternalDisplay.h" |
9 | 9 | #include <TargetConditionals.h> |
| 10 | +#include <vector> |
10 | 11 |
|
11 | 12 | using std::vector; |
12 | 13 |
|
|
44 | 45 | } |
45 | 46 | UIScreen * externalScreen; |
46 | 47 | externalScreen = [[UIScreen screens] objectAtIndex:1]; |
47 | | - |
| 48 | + |
48 | 49 | for(int i = 0; i < [[externalScreen availableModes] count]; i++){ |
49 | 50 | UIScreenMode * screenMode = [[externalScreen availableModes] objectAtIndex:i]; |
50 | 51 | externalDislayModes.push_back(ofxiOSExternalDisplayMode()); |
|
61 | 62 | } |
62 | 63 | UIScreen * externalScreen; |
63 | 64 | externalScreen = [[UIScreen screens] objectAtIndex:1]; |
64 | | - |
| 65 | + |
65 | 66 | for(int i = 0; i < [[externalScreen availableModes] count]; i++){ |
66 | 67 | UIScreenMode * screenMode = [[externalScreen availableModes] objectAtIndex:i]; |
67 | 68 | if (screenMode.size.width == externalDisplayMode.width && |
68 | 69 | screenMode.size.height == externalDisplayMode.height && |
69 | 70 | screenMode.pixelAspectRatio == externalDisplayMode.pixelAspectRatio){ |
70 | | - |
| 71 | + |
71 | 72 | ofxiOSAppDelegate * appDelegate; |
72 | 73 | appDelegate = [[UIApplication sharedApplication] delegate]; |
73 | | - |
| 74 | + |
74 | 75 | bool bOk = [appDelegate displayOnScreenWithIndex:1 andScreenModeIndex:i]; |
75 | 76 | return bOk; |
76 | 77 | } |
77 | 78 | } |
78 | | - |
| 79 | + |
79 | 80 | return false; |
80 | 81 | } |
81 | 82 |
|
|
94 | 95 | break; |
95 | 96 | } |
96 | 97 | } |
97 | | - |
| 98 | + |
98 | 99 | if(!bFound){ |
99 | 100 | return false; |
100 | 101 | } |
101 | | - |
| 102 | + |
102 | 103 | ofxiOSAppDelegate * appDelegate; |
103 | 104 | appDelegate = [[UIApplication sharedApplication] delegate]; |
104 | | - |
| 105 | + |
105 | 106 | bool bOk = [appDelegate displayOnScreenWithIndex:1 andScreenModeIndex:i]; |
106 | 107 | return bOk; |
107 | 108 | } |
108 | 109 |
|
109 | 110 | bool ofxiOSExternalDisplay::displayOnDeviceScreen(){ |
110 | 111 | ofxiOSAppDelegate * appDelegate; |
111 | 112 | appDelegate = [[UIApplication sharedApplication] delegate]; |
112 | | - |
| 113 | + |
113 | 114 | bool bOk = [appDelegate displayOnScreenWithIndex:0 andScreenModeIndex:0]; |
114 | 115 | return bOk; |
115 | 116 | } |
|
127 | 128 |
|
128 | 129 | [appDelegate destroyExternalWindow]; |
129 | 130 | return true; |
130 | | - |
| 131 | + |
131 | 132 | // the below code checks if the display is being mirrored. |
132 | 133 | // the problem is that this does not take effect straight away and always returns as false. |
133 | 134 | // the user will have to check themselves if mirroring is working by calling isMirroring() |
|
0 commit comments