Skip to content

Commit 55989f3

Browse files
committed
Merge branch 'master' into android_fixes_b
* master: (46 commits) ofCairoRenderer reordering fields (openframeworks#6883) ofxTruetypeFont: Added index property to settings so fonts with several styles can be loaded. This shouldnt break anything . It is just exposing this feature (openframeworks#6875) Bugfix CI armv7 (openframeworks#6886) ofxOsc - Excluding a include folder for macOs (openframeworks#6843) ofVec3f to glm::vec3 in doxygen comments (openframeworks#6853) Removing unneeded includes (openframeworks#6852) replace loadModel with load (openframeworks#6873) replace loadModel with load (openframeworks#6874) fix doxygen comment from ofMatrix4x4 to glm::mat4 (openframeworks#6857) add type alias of template arguments for get size of type strictly (openframeworks#6856) ofCamera - removing ofVec2f from doxygen (openframeworks#6859) fix spell from extention to extension (openframeworks#6861) fix documents about replacing ofVecNf to glm::vecN (openframeworks#6855) remove ofVec2f (openframeworks#6854) ofVec3f removal (openframeworks#6851) make cwd free (openframeworks#6847) remove duplicate include ofMesh.h (openframeworks#6850) Removing duplicate include ofMesh.h (openframeworks#6849) ios sound player to allow bluetooth audio (openframeworks#6840) std::move here (openframeworks#6846) ... # Conflicts: # libs/openFrameworks/graphics/ofTrueTypeFont.cpp
2 parents 8cb2f4f + c5ef119 commit 55989f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+233
-170
lines changed

addons/ofxOsc/addon_config.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ common:
6363
# when parsing the file system looking for sources exclude this for all or
6464
# a specific platform
6565
ADDON_SOURCES_EXCLUDE = libs/oscpack/src/ip/win32/%
66-
66+
ADDON_INCLUDES_EXCLUDE = libs/oscpack/src/ip/win32
6767
# when parsing the file system looking for include paths exclude this for all or
6868
# a specific platform
6969
# ADDON_INCLUDES_EXCLUDE =
@@ -78,3 +78,5 @@ vs:
7878
# a specific platform
7979
ADDON_SOURCES_EXCLUDE = libs/oscpack/src/ip/posix/%
8080
ADDON_DEFINES = OSC_HOST_LITTLE_ENDIAN
81+
82+

addons/ofxiOS/src/sound/AVSoundPlayer.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,26 @@ - (void) setupSharedSession {
3434
return;
3535
}
3636
NSString * playbackCategory = AVAudioSessionCategoryPlayAndRecord;
37-
#ifdef TARGET_OF_TVOS
37+
#ifdef TARGET_OS_TV
3838
playbackCategory = AVAudioSessionCategoryPlayback;
3939
#endif
4040
[[AVAudioSession sharedInstance] setCategory:playbackCategory error: nil];
4141
AVAudioSession * audioSession = [AVAudioSession sharedInstance];
4242
NSError * err = nil;
4343
// need to configure set the audio category, and override to it route the audio to the speaker
4444
if([audioSession respondsToSelector:@selector(setCategory:withOptions:error:)]) {
45+
#if defined (TARGET_OS_TV) || defined (TARGET_OS_WATCH)
4546
if(![audioSession setCategory:playbackCategory
46-
withOptions:AVAudioSessionCategoryOptionMixWithOthers
47+
withOptions:(AVAudioSessionCategoryOptionMixWithOthers)
48+
error:&err]) { err = nil; }
49+
#else
50+
if(![audioSession setCategory:playbackCategory
51+
withOptions:(AVAudioSessionCategoryOptionMixWithOthers |
52+
AVAudioSessionCategoryOptionAllowAirPlay |
53+
AVAudioSessionCategoryOptionAllowBluetooth |
54+
AVAudioSessionCategoryOptionAllowBluetoothA2DP)
4755
error:&err]) { err = nil; }
56+
#endif
4857
}
4958
[[AVAudioSession sharedInstance] setActive: YES error: nil];
5059
audioSessionSetup = YES;

addons/ofxiOS/src/sound/ofxiOSSoundStream.mm

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,44 @@
160160
#ifdef __IPHONE_6_0
161161
if(bMix) {
162162
if([audioSession respondsToSelector:@selector(setCategory:withOptions:error:)]) {
163+
#if defined (TARGET_OF_TVOS) || defined (TARGET_OF_WATCHOS)
163164
if([audioSession setCategory:AVAudioSessionCategoryPlayAndRecord
164-
withOptions:AVAudioSessionCategoryOptionMixWithOthers
165-
error:nil]) {
165+
withOptions:(AVAudioSessionCategoryOptionMixWithOthers)
166+
error:nil]) {
166167
success = true;
167168
}
169+
#else
170+
if([audioSession setCategory:AVAudioSessionCategoryPlayAndRecord
171+
withOptions:(AVAudioSessionCategoryOptionMixWithOthers |
172+
AVAudioSessionCategoryOptionAllowAirPlay |
173+
AVAudioSessionCategoryOptionAllowBluetooth |
174+
AVAudioSessionCategoryOptionAllowBluetoothA2DP)
175+
error:nil]) {
176+
success = true;
177+
}
178+
#endif
168179
}
169180
} else {
170181
#endif
171182

172183
// this is the default category + options setup
173184
// Note: using a sound input stream will set the category to PlayAndRecord
174-
if([audioSession setCategory:AVAudioSessionCategorySoloAmbient error:nil]) {
175-
success = true;
176-
}
177-
185+
#if defined (TARGET_OF_TVOS) || defined (TARGET_OF_WATCHOS)
186+
if([audioSession setCategory:AVAudioSessionCategorySoloAmbient
187+
error:nil]) {
188+
success = true;
189+
}
190+
#else
191+
if([audioSession setCategory:AVAudioSessionCategorySoloAmbient
192+
withOptions:(
193+
AVAudioSessionCategoryOptionAllowAirPlay |
194+
AVAudioSessionCategoryOptionAllowBluetooth |
195+
AVAudioSessionCategoryOptionAllowBluetoothA2DP)
196+
error:nil]) {
197+
success = true;
198+
}
199+
#endif
200+
178201
#ifdef __IPHONE_6_0
179202
}
180203
#endif

addons/ofxiOS/src/tvOS/ofxtvOSGLKViewController.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
#pragma once
77

8-
#ifndef ofxtvOSViewController_h
9-
#define ofxtvOSViewController_h
8+
#ifndef ofxtvOSGLKViewController_h
9+
#define ofxtvOSGLKViewController_h
1010

1111
#import <UIKit/UIKit.h>
1212
#import <GLKit/GLKit.h>

addons/ofxiOS/src/utils/ofxiOSExtras.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ ofxiOSDeviceInfo ofxiOSGetDeviceInfo(){
187187

188188
//--------------------------------------------------------------
189189
ofxtvOSViewController * ofxiOSGetViewController() {
190-
return [ofxiOSGetAppDelegate() glViewController];
190+
return (ofxtvOSViewController *)[ofxiOSGetAppDelegate() uiViewController];
191191
}
192192

193193
#endif

examples/3d/3DModelLoaderExample/src/ofApp.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void ofApp::setup(){
1111
ofSetVerticalSync(true);
1212

1313
// load the first model
14-
model.loadModel("penguin.dae", 20);
14+
model.load("penguin.dae", 20);
1515
// model info
1616
curFileInfo = ".dae";
1717

@@ -85,39 +85,39 @@ void ofApp::keyPressed(int key){
8585
switch (key){
8686
case '1':
8787
bUsingMesh = false;
88-
model.loadModel("penguin.dae");
88+
model.load("penguin.dae");
8989
model.setRotation(0, 180, 1, 0, 0);
9090
model.setScale(0.9, 0.9, 0.9);
9191
cam.setDistance(700);
9292
curFileInfo = ".dae";
9393
break;
9494
case '2':
9595
bUsingMesh = false;
96-
model.loadModel("penguin.3ds");
96+
model.load("penguin.3ds");
9797
model.setRotation(0, 180, 1, 0, 0);
9898
model.setScale(0.9, 0.9, 0.9);
9999
cam.setDistance(700);
100100
curFileInfo = ".3ds";
101101
break;
102102
case '3':
103103
bUsingMesh = false;
104-
model.loadModel("penguin.ply");
104+
model.load("penguin.ply");
105105
model.setRotation(0, 90, 1, 0, 0);
106106
model.setScale(0.9, 0.9, 0.9);
107107
cam.setDistance(700);
108108
curFileInfo = ".ply";
109109
break;
110110
case '4':
111111
bUsingMesh = false;
112-
model.loadModel("penguin.obj");
112+
model.load("penguin.obj");
113113
model.setRotation(0, 90, 1, 0, 0);
114114
model.setScale(0.9, 0.9, 0.9);
115115
cam.setDistance(700);
116116
curFileInfo = ".obj";
117117
break;
118118
case '5':
119119
bUsingMesh = false;
120-
model.loadModel("penguin.stl");
120+
model.load("penguin.stl");
121121
model.setRotation(0, 90, 1, 0, 0);
122122
model.setScale(0.9, 0.9, 0.9);
123123
cam.setDistance(700);

examples/3d/assimpExample/src/ofApp.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void ofApp::setup(){
1111
bAnimateMouse = false;
1212
animationPosition = 0;
1313

14-
model.loadModel("astroBoy_walk.dae", false);
14+
model.load("astroBoy_walk.dae", false);
1515
model.setPosition(ofGetWidth() * 0.5, (float)ofGetHeight() * 0.75 , 0);
1616
model.setLoopStateForAllAnimations(OF_LOOP_NORMAL);
1717
model.playAllAnimations();
@@ -102,28 +102,28 @@ void ofApp::keyPressed(int key){
102102
glm::vec3 modelPosition(ofGetWidth() * 0.5, (float)ofGetHeight() * 0.75, 0);
103103
switch (key) {
104104
case '1':
105-
model.loadModel("astroBoy_walk.dae");
105+
model.load("astroBoy_walk.dae");
106106
model.setPosition(modelPosition.x, modelPosition.y, modelPosition.z);
107107
ofEnableSeparateSpecularLight();
108108
break;
109109
case '2':
110-
model.loadModel("TurbochiFromXSI.dae");
110+
model.load("TurbochiFromXSI.dae");
111111
model.setPosition(modelPosition.x, modelPosition.y, modelPosition.z);
112112
ofEnableSeparateSpecularLight();
113113
break;
114114
case '3':
115-
model.loadModel("dwarf.x");
115+
model.load("dwarf.x");
116116
model.setPosition(modelPosition.x, modelPosition.y, modelPosition.z);
117117
ofDisableSeparateSpecularLight();
118118
break;
119119
case '4':
120-
model.loadModel("monster-animated-character-X.X");
120+
model.load("monster-animated-character-X.X");
121121
model.setPosition(modelPosition.x, modelPosition.y, modelPosition.z);
122122
model.setRotation(0, -90, 0, 0, 1);
123123
ofDisableSeparateSpecularLight();
124124
break;
125125
case '5':
126-
model.loadModel("squirrel/NewSquirrel.3ds");
126+
model.load("squirrel/NewSquirrel.3ds");
127127
model.setPosition(modelPosition.x, modelPosition.y, modelPosition.z);
128128
ofDisableSeparateSpecularLight();
129129
break;

libs/openFrameworks/3d/of3dUtils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ void ofDrawGridPlane(float stepSize = 1.25f, size_t numberOfSteps = 8, bool labe
5454
///
5555
/// ~~~~{.cpp}
5656
/// ofSetColor(0,0,0);
57-
/// ofVec3f arrowTailPoint (0,0,0);
58-
/// ofVec3f arrowHeadPoint (100, 150,0);
57+
/// glm::vec3 arrowTailPoint (0,0,0);
58+
/// glm::vec3 arrowHeadPoint (100, 150,0);
5959
/// ofDrawArrow(arrowTailPoint, arrowHeadPoint, 20.0);
6060
/// ~~~~
6161
///
62-
/// \param start The start point (tail) of the arrow, expressed as an ofVec3f.
63-
/// \param end The end point (head) of the arrow, expressed as an ofVec3f.
62+
/// \param start The start point (tail) of the arrow, expressed as an glm::vec3.
63+
/// \param end The end point (head) of the arrow, expressed as an glm::vec3.
6464
/// \param headSize The size of the arrowhead.
6565
void ofDrawArrow(const glm::vec3& start, const glm::vec3& end, float headSize = 0.05f);
6666

libs/openFrameworks/3d/ofCamera.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ class ofCamera : public ofNode {
4747
/// offset from the center of its frustum. This is called an "assymetric
4848
/// frustum" and is used (for example) in stereo views. It is acheived by
4949
/// applying an offset to the center of projection. This function sets this
50-
/// offset from an ofVec2f argument. For more information see
50+
/// offset from an glm::vec2 argument. For more information see
5151
/// <http://www.orthostereo.com/geometryopengl.html>.
5252
///
5353
/// \param lensOffset The "lens offset" to apply to this camera, encoded in
54-
/// an ofVec2f.
54+
/// an glm::vec2.
5555
void setLensOffset(const glm::vec2 & lensOffset);
5656

5757
/// \brief Set the recommended aspect ratio for a perspective camera.
@@ -86,17 +86,17 @@ class ofCamera : public ofNode {
8686

8787
float getFarClip() const { return farClip; };
8888

89-
/// \brief Get the "lens offset" applied to this camera, encoded as an ofVec2f.
89+
/// \brief Get the "lens offset" applied to this camera, encoded as an glm::vec2.
9090
///
9191
/// Ordinarily, the camera is pointed straight down the center of its view
9292
/// frustum. However, it is possible to orient the camera towards a
9393
/// location offset from the center of its frustum. This is called an
9494
/// "asymetric frustum" and is used (for example) in stereo views. It is
9595
/// acheived by applying an offset to the center of projection. This
96-
/// function returns the offset that has been applied, as an ofVec2f. For
96+
/// function returns the offset that has been applied, as an glm::vec2. For
9797
/// more information see http://www.orthostereo.com/geometryopengl.html.
9898
///
99-
/// \returns The "lens offset" applied to this camera, encoded in an ofVec2f.
99+
/// \returns The "lens offset" applied to this camera, encoded in an glm::vec2.
100100
glm::vec2 getLensOffset() const { return lensOffset; };
101101

102102
/// \brief Get the boolean state which indicates whether the aspect ratio of this camera is forced to a non-default setting.
@@ -187,23 +187,23 @@ class ofCamera : public ofNode {
187187

188188
/// \brief Obtain the screen coordinates of a point in the 3D world.
189189
///
190-
/// Takes an (X,Y,Z) point in your 3D world, encoded as an ofVec3f,
191-
/// and returns the location (also as an ofVec3f) where this point would
190+
/// Takes an (X,Y,Z) point in your 3D world, encoded as an glm::vec3,
191+
/// and returns the location (also as an glm::vec3) where this point would
192192
/// appear on your (two-dimensional) display. The screen position's "Z
193193
/// coordinate" is set to be the same as your camera's.
194194
///
195195
/// \param WorldXYZ A 3D point in the world, whose screen coordinates you wish to know.
196196
/// \param viewport (Optional) A viewport. The default is ofGetCurrentViewport().
197-
/// \returns An ofVec3f containing the screen coordinates of your 3D point of interest.
197+
/// \returns An glm::vec3 containing the screen coordinates of your 3D point of interest.
198198
glm::vec3 worldToScreen(glm::vec3 WorldXYZ, const ofRectangle & viewport) const;
199199
glm::vec3 worldToScreen(glm::vec3 WorldXYZ) const{
200200
return worldToScreen(WorldXYZ, getViewport());
201201
}
202202

203203
/// \brief Obtain the coordinates, in the 3D world, of a 2D point presumed to be on your screen.
204204
///
205-
/// Takes a pixel location on your screen, encoded in an ofVec3f,
206-
/// and returns (also as an ofVec3f) the 3D world coordinates of that point.
205+
/// Takes a pixel location on your screen, encoded in an glm::vec3,
206+
/// and returns (also as an glm::vec3) the 3D world coordinates of that point.
207207
/// You'll also need to specify a Z value when providing your screen point.
208208
/// This Z value is interpreted as a distance into or away from the screen.
209209
///

libs/openFrameworks/3d/ofMesh.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ class ofMeshFace_;
7878
template<class V, class N, class C, class T>
7979
class ofMesh_{
8080
public:
81-
81+
using VertexType = V;
82+
using NormalType = N;
83+
using ColorType = C;
84+
using TexCoordType = T;
8285
/// \name Construction
8386
/// \{
8487

@@ -231,7 +234,7 @@ class ofMesh_{
231234

232235
void mergeDuplicateVertices();
233236

234-
/// \returns a ofVec3f defining the centroid of all the vetices in the mesh.
237+
/// \returns a glm::vec3 defining the centroid of all the vetices in the mesh.
235238
V getCentroid() const;
236239

237240

@@ -432,7 +435,7 @@ class ofMesh_{
432435
/// \returns a pointer to the texture coords that the mesh contains.
433436
T* getTexCoordsPointer();
434437

435-
/// \brief Get a pointer to the ofVec2f texture coordinates that the mesh contains.
438+
/// \brief Get a pointer to the glm::vec2 texture coordinates that the mesh contains.
436439
const T* getTexCoordsPointer() const;
437440

438441
/// \brief Get a vector representing the texture coordinates of the mesh

libs/openFrameworks/3d/ofNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ void ofNode::rotateRad(float radians, float vx, float vy, float vz) {
396396

397397
//----------------------------------------
398398
void ofNode::rotateAround(const glm::quat& q, const glm::vec3& point) {
399-
// ofLogVerbose("ofNode") << "rotateAround(const glm::quat& q, const ofVec3f& point) not implemented yet";
400-
// ofMatrix4x4 m = getLocalTransformMatrix();
399+
// ofLogVerbose("ofNode") << "rotateAround(const glm::quat& q, const glm::vec3& point) not implemented yet";
400+
// glm::mat4 m = getLocalTransformMatrix();
401401
// m.setTranslation(point);
402402
// m.rotate(q);
403403

libs/openFrameworks/app/ofAppGLFWWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ void ofAppGLFWWindow::setFullscreen(bool fullscreen){
857857
GLFWmonitor** monitors = glfwGetMonitors(&monitorCount);
858858

859859
int currentMonitor = getCurrentMonitor();
860-
ofVec3f screenSize = getScreenSize();
860+
auto screenSize = getScreenSize();
861861

862862
if( orientation == OF_ORIENTATION_90_LEFT || orientation == OF_ORIENTATION_90_RIGHT ){
863863
std::swap(screenSize.x, screenSize.y);
@@ -913,7 +913,7 @@ void ofAppGLFWWindow::setFullscreen(bool fullscreen){
913913

914914
// make sure to save current pos if not specified in settings
915915
if( settings.isPositionSet() ) {
916-
ofVec3f pos = getWindowPosition();
916+
auto pos = getWindowPosition();
917917
settings.setPosition(ofVec2f(pos.x, pos.y));
918918
}
919919

libs/openFrameworks/communication/ofSerial.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ void ofSerial::enumerateWin32Ports(){
6969

7070
char * begin = nullptr;
7171
char * end = nullptr;
72-
begin = strstr((char *)dataBuf, "COM");
72+
begin = strstr((char *)dataBuf, "(COM");
7373

7474
if(begin){
75+
begin++; // get rid of the (
7576
end = strstr(begin, ")");
7677
if(end){
7778
*end = 0; // get rid of the )...

0 commit comments

Comments
 (0)