Skip to content

Commit 514e23f

Browse files
committed
reflect changes from inc PR, main OF
1 parent 6b7c7d7 commit 514e23f

File tree

14 files changed

+148
-129
lines changed

14 files changed

+148
-129
lines changed

addons/ofxiOS/src/utils/ofxiOSExternalDisplay.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#pragma once
99

1010
#include "ofConstants.h"
11+
#include <vector>
1112

1213
#include <TargetConditionals.h>
1314
#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)
@@ -19,14 +20,14 @@ struct ofxiOSExternalDisplayMode{
1920
};
2021

2122
class ofxiOSExternalDisplay {
22-
23+
2324
public:
24-
25+
2526
//-------------------------------------------------------
2627
static void alertExternalDisplayConnected();
2728
static void alertExternalDisplayDisconnected();
2829
static void alertExternalDisplayChanged();
29-
30+
3031
//-------------------------------------------------------
3132
static std::vector<ofxiOSExternalDisplayMode> getExternalDisplayModes();
3233
static bool displayOnExternalScreen(ofxiOSExternalDisplayMode externalDisplayMode);
@@ -40,16 +41,16 @@ class ofxiOSExternalDisplay {
4041
static bool isDisplayingOnDeviceScreen();
4142
static bool isExternalScreenConnected();
4243
static bool isMirroring();
43-
44+
4445
//-------------------------------------------------------
4546
ofxiOSExternalDisplay();
4647
~ofxiOSExternalDisplay();
47-
48+
4849
//-------------------------------------------------------
4950
virtual void externalDisplayConnected(){}
5051
virtual void externalDisplayDisconnected(){}
5152
virtual void externalDisplayChanged(){}
52-
53+
5354
};
5455

5556
#define ofxiPhoneExternalDisplay ofxiOSExternalDisplay

addons/ofxiOS/src/utils/ofxiOSExternalDisplay.mm

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "ofxiOSExternalDisplay.h"
99
#include <TargetConditionals.h>
10+
#include <vector>
1011

1112
using std::vector;
1213

@@ -44,7 +45,7 @@
4445
}
4546
UIScreen * externalScreen;
4647
externalScreen = [[UIScreen screens] objectAtIndex:1];
47-
48+
4849
for(int i = 0; i < [[externalScreen availableModes] count]; i++){
4950
UIScreenMode * screenMode = [[externalScreen availableModes] objectAtIndex:i];
5051
externalDislayModes.push_back(ofxiOSExternalDisplayMode());
@@ -61,21 +62,21 @@
6162
}
6263
UIScreen * externalScreen;
6364
externalScreen = [[UIScreen screens] objectAtIndex:1];
64-
65+
6566
for(int i = 0; i < [[externalScreen availableModes] count]; i++){
6667
UIScreenMode * screenMode = [[externalScreen availableModes] objectAtIndex:i];
6768
if (screenMode.size.width == externalDisplayMode.width &&
6869
screenMode.size.height == externalDisplayMode.height &&
6970
screenMode.pixelAspectRatio == externalDisplayMode.pixelAspectRatio){
70-
71+
7172
ofxiOSAppDelegate * appDelegate;
7273
appDelegate = [[UIApplication sharedApplication] delegate];
73-
74+
7475
bool bOk = [appDelegate displayOnScreenWithIndex:1 andScreenModeIndex:i];
7576
return bOk;
7677
}
7778
}
78-
79+
7980
return false;
8081
}
8182

@@ -94,22 +95,22 @@
9495
break;
9596
}
9697
}
97-
98+
9899
if(!bFound){
99100
return false;
100101
}
101-
102+
102103
ofxiOSAppDelegate * appDelegate;
103104
appDelegate = [[UIApplication sharedApplication] delegate];
104-
105+
105106
bool bOk = [appDelegate displayOnScreenWithIndex:1 andScreenModeIndex:i];
106107
return bOk;
107108
}
108109

109110
bool ofxiOSExternalDisplay::displayOnDeviceScreen(){
110111
ofxiOSAppDelegate * appDelegate;
111112
appDelegate = [[UIApplication sharedApplication] delegate];
112-
113+
113114
bool bOk = [appDelegate displayOnScreenWithIndex:0 andScreenModeIndex:0];
114115
return bOk;
115116
}
@@ -127,7 +128,7 @@
127128

128129
[appDelegate destroyExternalWindow];
129130
return true;
130-
131+
131132
// the below code checks if the display is being mirrored.
132133
// the problem is that this does not take effect straight away and always returns as false.
133134
// the user will have to check themselves if mirroring is working by calling isMirroring()

0 commit comments

Comments
 (0)