Skip to content

Commit cc5f924

Browse files
authored
batch of fixes to the iOS examples (#7373)
#changelog #ios
1 parent ae76a71 commit cc5f924

File tree

8 files changed

+112
-601
lines changed

8 files changed

+112
-601
lines changed

examples/ios/audioInputExample/src/ofApp.mm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
drawCounter = 0;
1212
bufferCounter = 0;
1313

14-
sound.load("sounds/beat.caf");
15-
sound.setLoop(true);
16-
sound.play();
17-
sound.setVolume(0);
14+
// sound.load("sounds/beat.caf");
15+
// sound.setLoop(true);
16+
// sound.play();
17+
// sound.setVolume(0);
1818

1919
ofSoundStreamSettings settings;
2020
settings.setInListener(this);
@@ -76,12 +76,12 @@
7676

7777
//--------------------------------------------------------------
7878
void ofApp::touchDown(ofTouchEventArgs & touch){
79-
sound.setVolume(1.0);
79+
// sound.setVolume(1.0);
8080
}
8181

8282
//--------------------------------------------------------------
8383
void ofApp::touchUp(ofTouchEventArgs & touch){
84-
sound.setVolume(0.0);
84+
// sound.setVolume(0.0);
8585
}
8686

8787
//--------------------------------------------------------------

examples/ios/fontShapesExample/src/ofApp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ofApp : public ofxiOSApp{
2323

2424
ofTrueTypeFont testFont;
2525
ofTrueTypeFont testFont2;
26-
ofTTFCharacter testChar;
26+
ofPath testChar;
2727

2828
int letter;
2929

examples/ios/iPhoneGuiExample/src/gui/MyGuiView.xib

Lines changed: 92 additions & 581 deletions
Large diffs are not rendered by default.

examples/ios/iosCoreMotionLegacyExample/src/main.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ int main() {
1212
settings.enableHardwareOrientation = false; // enables native view orientation.
1313
settings.enableHardwareOrientationAnimation = false; // enables native orientation changes to be animated.
1414
settings.glesVersion = OFXIOS_RENDERER_ES1; // type of renderer to use, ES1, ES2, etc.
15+
settings.enableMultiTouch = true;
1516

1617
ofCreateWindow(settings);
1718

examples/ios/iosStoryboardExample/src/UI/MyAppDelegate.mm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1414

1515
[super applicationDidFinishLaunching:application];
1616

17-
self.navigationController = [[[UINavigationController alloc] init] autorelease];
17+
self.navigationController = [[UINavigationController alloc] init];
1818
[self.window setRootViewController:self.navigationController];
1919

2020
UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"MyApp" bundle:nil];
@@ -29,7 +29,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2929

3030
- (void) dealloc {
3131
self.navigationController = nil;
32-
[super dealloc];
3332
}
3433

3534
@end

examples/ios/ofxGuiExample/src/ofApp.mm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//--------------------------------------------------------------
44
void ofApp::setup(){
55

6-
//ofSetOrientation(OF_ORIENTATION_90_LEFT);
6+
// ofSetOrientation(OF_ORIENTATION_90_LEFT);
77
ofSetVerticalSync(true);
8-
8+
99
// we add this listener before setting up so the initial circle resolution is correct
1010
circleResolution.addListener(this, &ofApp::circleResolutionChanged);
1111
ringButton.addListener(this,&ofApp::ringButtonPressed);
@@ -16,16 +16,16 @@
1616
ofxGuiSetDefaultWidth(300);
1717
ofxGuiSetDefaultHeight(18);
1818

19-
gui.setup("panel"); // most of the time you don't need a name but don't forget to call setup
19+
// gui.setup("panel"); // most of the time you don't need a name but don't forget to call setup
2020
gui.add(filled.set("bFill", true));
2121
gui.add(radius.set( "radius", 140, 10, 300 ));
2222
gui.add(center.set("center",glm::vec2(ofGetWidth()*.5,ofGetHeight()*.75),glm::vec2(0,0),glm::vec2(ofGetWidth(),ofGetHeight())));
23-
gui.add(color.set("color",ofColor(100,100,140),ofColor(0,0),ofColor(255,255)));
23+
gui.add(color.set("color",ofColor(100,100,140),ofColor(0,0,0),ofColor(255,255,255)));
2424
gui.add(circleResolution.set("circleRes", 5, 3, 90));
2525
gui.add(twoCircles.setup("twoCircles"));
2626
gui.add(ringButton.setup("ring"));
2727
gui.add(screenSize.set("screenSize", ofToString(ofGetWidth()) + "x" + ofToString(ofGetHeight())));
28-
28+
2929
bHide = true;
3030

3131
ring.load("ring.wav");
@@ -65,7 +65,7 @@
6565
}else{
6666
ofDrawCircle((glm::vec2)center, radius );
6767
}
68-
68+
6969
if( bHide ){
7070
gui.draw();
7171
}

examples/ios/opencvFaceExample/src/ofApp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "ofxOpenCv.h"
66

77
//UNCOMMENT TO USE CAMERA. CAMERA ONLY WORKS ON DEVICE NOT SIMULATOR
8-
//#define USE_CAMERA
8+
#define USE_CAMERA
99

1010
class ofApp : public ofxiOSApp{
1111

examples/ios/vboExample/src/ofApp.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
int z = (j * space) - center.y;
5959
int index = (j*GRID_WIDTH+i) * LENGTH;
6060

61-
pos[index].set(x, y, z);
62-
pos[index+1].set(x+ofRandom(-r,r), y+ofRandom(-r,r), z+ofRandom(-r,r));
61+
pos[index] = {x, y, z};
62+
pos[index+1] = {x+ofRandom(-r,r), y+ofRandom(-r,r), z+ofRandom(-r,r)};
6363
pos[index+1].y -= 1.0;
6464

6565
for (int k=2; k<LENGTH; k++) {
@@ -85,8 +85,8 @@
8585
ofPushMatrix();
8686
ofTranslate(ofGetWidth()/2, ofGetHeight()/2, zoom);
8787

88-
ofRotate(mouseX, 1, 0, 0);
89-
ofRotate(mouseY, 0, 1, 1);
88+
ofRotateDeg(mouseX, 1, 0, 0);
89+
ofRotateDeg(mouseY, 0, 1, 1);
9090

9191

9292
// the lines

0 commit comments

Comments
 (0)