diff --git a/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.h b/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.h index 5ef97c759bf..822b5e99050 100644 --- a/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.h +++ b/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.h @@ -8,6 +8,8 @@ #pragma once #include "ofConstants.h" +#include + #include #if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV) @@ -19,14 +21,14 @@ struct ofxiOSExternalDisplayMode{ }; class ofxiOSExternalDisplay { - + public: - + //------------------------------------------------------- static void alertExternalDisplayConnected(); static void alertExternalDisplayDisconnected(); static void alertExternalDisplayChanged(); - + //------------------------------------------------------- static std::vector getExternalDisplayModes(); static bool displayOnExternalScreen(ofxiOSExternalDisplayMode externalDisplayMode); @@ -40,16 +42,16 @@ class ofxiOSExternalDisplay { static bool isDisplayingOnDeviceScreen(); static bool isExternalScreenConnected(); static bool isMirroring(); - + //------------------------------------------------------- ofxiOSExternalDisplay(); ~ofxiOSExternalDisplay(); - + //------------------------------------------------------- virtual void externalDisplayConnected(){} virtual void externalDisplayDisconnected(){} virtual void externalDisplayChanged(){} - + }; #define ofxiPhoneExternalDisplay ofxiOSExternalDisplay diff --git a/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.mm b/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.mm index 1e25ba25bfd..9d54d41e89d 100644 --- a/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.mm +++ b/addons/ofxiOS/src/utils/ofxiOSExternalDisplay.mm @@ -7,6 +7,7 @@ #include "ofxiOSExternalDisplay.h" #include +#include using std::vector; diff --git a/libs/openFrameworks/3d/of3dPrimitives.h b/libs/openFrameworks/3d/of3dPrimitives.h index 1b30e574c55..dd371614bef 100644 --- a/libs/openFrameworks/3d/of3dPrimitives.h +++ b/libs/openFrameworks/3d/of3dPrimitives.h @@ -2,6 +2,7 @@ #include "ofMesh.h" #include "ofNode.h" +#include class ofTexture; class ofVboMesh; diff --git a/libs/openFrameworks/3d/ofMesh.h b/libs/openFrameworks/3d/ofMesh.h index c6b28cfa6ab..c42e2d68d61 100644 --- a/libs/openFrameworks/3d/ofMesh.h +++ b/libs/openFrameworks/3d/ofMesh.h @@ -4,6 +4,7 @@ #define OF_MESH_H #include "ofGLUtils.h" +#include template class ofMeshFace_; diff --git a/libs/openFrameworks/communication/ofSerial.h b/libs/openFrameworks/communication/ofSerial.h index fb787be5dd9..178bc3d61f1 100644 --- a/libs/openFrameworks/communication/ofSerial.h +++ b/libs/openFrameworks/communication/ofSerial.h @@ -6,6 +6,7 @@ // MARK: ofConstants targets #include "ofConstants.h" +#include class ofBuffer; diff --git a/libs/openFrameworks/gl/ofBufferObject.h b/libs/openFrameworks/gl/ofBufferObject.h index d7d4fe15280..637a5b318b1 100644 --- a/libs/openFrameworks/gl/ofBufferObject.h +++ b/libs/openFrameworks/gl/ofBufferObject.h @@ -2,6 +2,7 @@ // MARK: Targets plus GL/ headers #include "ofConstants.h" +#include template class ofPixels_; diff --git a/libs/openFrameworks/gl/ofGLUtils.h b/libs/openFrameworks/gl/ofGLUtils.h index 5a046826a5f..f777a7a32e3 100644 --- a/libs/openFrameworks/gl/ofGLUtils.h +++ b/libs/openFrameworks/gl/ofGLUtils.h @@ -8,9 +8,11 @@ #pragma once #include "ofGraphicsConstants.h" +#include // MARK: Targets / Defines //#include "ofConstants.h" + class ofShader; class ofGLProgrammableRenderer; class ofBaseGLRenderer; diff --git a/libs/openFrameworks/gl/ofShader.cpp b/libs/openFrameworks/gl/ofShader.cpp index 208f6f313fe..9fc24210f4d 100644 --- a/libs/openFrameworks/gl/ofShader.cpp +++ b/libs/openFrameworks/gl/ofShader.cpp @@ -8,6 +8,7 @@ #include "ofxAndroidUtils.h" #endif #include +#include using std::endl; using std::ostringstream; @@ -958,7 +959,7 @@ void ofShader::setUniformTexture(const string & name, const ofTexture & tex, int setUniformTexture( name, texData, textureLocation); } } - + //-------------------------------------------------------------- void ofShader::setUniformTexture(const string & name, const ofTextureData & texData, int textureLocation) const{ if (bLoaded) { diff --git a/libs/openFrameworks/gl/ofShader.h b/libs/openFrameworks/gl/ofShader.h index d17f4ec1b99..c0330b67ccd 100644 --- a/libs/openFrameworks/gl/ofShader.h +++ b/libs/openFrameworks/gl/ofShader.h @@ -9,6 +9,7 @@ // MARK: ofConstants Targets #include "ofConstants.h" +#include #include namespace glm { diff --git a/libs/openFrameworks/graphics/ofPixels.cpp b/libs/openFrameworks/graphics/ofPixels.cpp index 4a3b2273933..45863b8dcdb 100644 --- a/libs/openFrameworks/graphics/ofPixels.cpp +++ b/libs/openFrameworks/graphics/ofPixels.cpp @@ -1,6 +1,8 @@ #include "ofGraphicsConstants.h" #include "ofPixels.h" #include "ofColor.h" +#include // memcpy +#include // std::function static ofImageType getImageTypeFromChannels(size_t channels){ switch(channels){ diff --git a/libs/openFrameworks/graphics/ofTessellator.h b/libs/openFrameworks/graphics/ofTessellator.h index c54656a3f20..4a37c43c797 100644 --- a/libs/openFrameworks/graphics/ofTessellator.h +++ b/libs/openFrameworks/graphics/ofTessellator.h @@ -1,6 +1,7 @@ #pragma once #include "ofGraphicsBaseTypes.h" +#include typedef struct TESStesselator TESStesselator; typedef struct TESSalloc TESSalloc; diff --git a/libs/openFrameworks/graphics/ofTrueTypeFont.h b/libs/openFrameworks/graphics/ofTrueTypeFont.h index 77afeab0d94..74c941a39e7 100644 --- a/libs/openFrameworks/graphics/ofTrueTypeFont.h +++ b/libs/openFrameworks/graphics/ofTrueTypeFont.h @@ -6,6 +6,7 @@ #include "ofRectangle.h" #include "ofTexture.h" #include +#include class ofPath; diff --git a/libs/openFrameworks/ofMain.h b/libs/openFrameworks/ofMain.h index 602116e0589..c370881f208 100644 --- a/libs/openFrameworks/ofMain.h +++ b/libs/openFrameworks/ofMain.h @@ -134,3 +134,15 @@ using std::vector; using std::weak_ptr; #endif #endif + + +// core: --------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/libs/openFrameworks/sound/ofRtAudioSoundStream.cpp b/libs/openFrameworks/sound/ofRtAudioSoundStream.cpp index 55827959e7c..85d31d3f11a 100644 --- a/libs/openFrameworks/sound/ofRtAudioSoundStream.cpp +++ b/libs/openFrameworks/sound/ofRtAudioSoundStream.cpp @@ -4,6 +4,7 @@ #include "ofAppRunner.h" #include "ofLog.h" #include +#include using std::vector; using std::shared_ptr; @@ -146,7 +147,7 @@ bool ofRtAudioSoundStream::setup(const ofSoundStreamSettings & settings_) ofLogNotice() << "Initialing RtAudio with UNSPECIFIED API"; audio = std::make_shared(); } - //needs latest RtAudio - this breaks in slightly older linux + //needs latest RtAudio - this breaks in slightly older linux //ofLogNotice() << "Initialized RtAudio with API: " << RtAudio::getApiName(audio->getCurrentApi()); } catch (std::exception &error) { diff --git a/libs/openFrameworks/sound/ofSoundBaseTypes.h b/libs/openFrameworks/sound/ofSoundBaseTypes.h index 9996621a2a5..dcbcc2bae68 100644 --- a/libs/openFrameworks/sound/ofSoundBaseTypes.h +++ b/libs/openFrameworks/sound/ofSoundBaseTypes.h @@ -3,6 +3,7 @@ // MARK: ofConstants FS #include "ofConstants.h" #include +#include class ofSoundBuffer; diff --git a/libs/openFrameworks/sound/ofSoundBuffer.cpp b/libs/openFrameworks/sound/ofSoundBuffer.cpp index 84881ede9b0..cceadfdaa20 100644 --- a/libs/openFrameworks/sound/ofSoundBuffer.cpp +++ b/libs/openFrameworks/sound/ofSoundBuffer.cpp @@ -17,6 +17,7 @@ #endif #include #include +#include using std::vector; using std::string; @@ -223,7 +224,7 @@ void ofSoundBuffer::copyTo(float * outBuffer, std::size_t nFrames, std::size_t o if ((fromFrame + nFrames) >= this->getNumFrames()){ nFramesToCopy = this->getNumFrames() - fromFrame; } - + const float * buffPtr = &buffer[fromFrame * channels]; // if channels count matches we can just memcpy if(channels == outChannels){ @@ -321,14 +322,14 @@ void ofSoundBuffer::append(ofSoundBuffer & other){ static bool prepareBufferForResampling(const ofSoundBuffer &in, ofSoundBuffer &out, std::size_t numFrames) { std::size_t totalOutBufferSize = numFrames * in.getNumChannels(); - + if(totalOutBufferSize < out.getBuffer().max_size()) { out.resize(totalOutBufferSize,0); } else { ofLogError("ofSoundUtils") << "resampling would create a buffer size of " << totalOutBufferSize << " (too large for std::vector)"; return false; } - + out.setNumChannels(in.getNumChannels()); out.setSampleRate(in.getSampleRate()); return true; @@ -337,16 +338,16 @@ static bool prepareBufferForResampling(const ofSoundBuffer &in, ofSoundBuffer &o // based on maximilian optimized for performance. // might lose 1 or 2 samples when it reaches the end of the buffer void ofSoundBuffer::linearResampleTo(ofSoundBuffer &outBuffer, std::size_t fromFrame, std::size_t numFrames, float speed, bool loop) const { - + std::size_t inChannels = getNumChannels(); std::size_t inFrames = getNumFrames(); bool bufferReady = prepareBufferForResampling(*this, outBuffer, numFrames); - + if(!bufferReady) { outBuffer = *this; return; } - + std::size_t start = fromFrame; std::size_t end = start*inChannels + double(numFrames*inChannels)*speed; double position = start; @@ -354,7 +355,7 @@ void ofSoundBuffer::linearResampleTo(ofSoundBuffer &outBuffer, std::size_t fromF float increment = speed; std::size_t copySize = inChannels*sizeof(float); std::size_t to; - + if(endinFrames){ @@ -362,11 +363,11 @@ void ofSoundBuffer::linearResampleTo(ofSoundBuffer &outBuffer, std::size_t fromF }else{ to = std::ceil(float(inFrames-2-fromFrame)/speed); } - + float remainder = position - intPosition; float * resBufferPtr = &outBuffer[0]; float a, b; - + for(std::size_t i=0;iinFrames){ @@ -427,11 +428,11 @@ void ofSoundBuffer::hermiteResampleTo(ofSoundBuffer &outBuffer, std::size_t from }else{ to = double(inFrames-3-fromFrame)/speed; } - + float * resBufferPtr = &outBuffer[0]; float a,b,c,d; std::size_t from = 0; - + while(intPosition==0){ intPosition *= inChannels; for(std::size_t j=0;j=size()-3*inChannels){ to = numFrames-to; if(loop){ @@ -535,7 +536,7 @@ void ofSoundBuffer::setChannel(const ofSoundBuffer & inBuffer, std::size_t targe *bufferPtr = *inBufferPtr; bufferPtr += channels; // inBuffer.getNumChannels() is probably 1 but let's be safe - inBufferPtr += inBuffer.getNumChannels(); + inBufferPtr += inBuffer.getNumChannels(); } } @@ -627,4 +628,3 @@ namespace std{ src.swap(dst); } } - diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index 7becf894bb2..83d903aaf9d 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -6,16 +6,7 @@ #define OF_VERSION_PATCH 1 #define OF_VERSION_PRE_RELEASE "" -// core: --------------------------- -#include -#include -#include -#include -#include -#include -#include -#include -#include + // Set to 1 for compatibility with old projects using ofVec instead of glm #ifndef OF_USE_LEGACY_VECTOR_MATH diff --git a/libs/openFrameworks/utils/ofFileUtils.h b/libs/openFrameworks/utils/ofFileUtils.h index c2ed03af9f3..e541dae392b 100644 --- a/libs/openFrameworks/utils/ofFileUtils.h +++ b/libs/openFrameworks/utils/ofFileUtils.h @@ -3,6 +3,7 @@ // MARK: ofConstants FS #include "ofConstants.h" #include +#include //---------------------------------------------------------- // ofBuffer diff --git a/libs/openFrameworks/utils/ofLog.cpp b/libs/openFrameworks/utils/ofLog.cpp index 7a75025fe22..121a2197235 100644 --- a/libs/openFrameworks/utils/ofLog.cpp +++ b/libs/openFrameworks/utils/ofLog.cpp @@ -1,6 +1,8 @@ #include "ofLog.h" #include #include +#include // std::function + #ifdef TARGET_ANDROID #include "ofxAndroidLogChannel.h" #endif @@ -82,7 +84,7 @@ ofLog::ofLog(){ module = ""; bPrinted = false; } - + //-------------------------------------------------- ofLog::ofLog(ofLogLevel _level){ level = _level; @@ -231,7 +233,7 @@ string ofGetLogLevelName(ofLogLevel level, bool pad){ //-------------------------------------------------- void ofConsoleLoggerChannel::log(ofLogLevel level, const string & module, const string & message){ - // print to cerr for OF_LOG_ERROR and OF_LOG_FATAL_ERROR, everything else to cout + // print to cerr for OF_LOG_ERROR and OF_LOG_FATAL_ERROR, everything else to cout std::ostream& out = level < OF_LOG_ERROR ? std::cout : std::cerr; out << "[" << ofGetLogLevelName(level, true) << "] "; // only print the module name if it's not "" @@ -245,7 +247,7 @@ void ofConsoleLoggerChannel::log(ofLogLevel level, const string & module, const #ifdef TARGET_WIN32 #include void ofDebugViewLoggerChannel::log(ofLogLevel level, const string & module, const string & message) { - // print to cerr for OF_LOG_ERROR and OF_LOG_FATAL_ERROR, everything else to cout + // print to cerr for OF_LOG_ERROR and OF_LOG_FATAL_ERROR, everything else to cout std::stringstream out; out << "[" << ofGetLogLevelName(level, true) << "] "; // only print the module name if it's not "" @@ -287,4 +289,3 @@ void ofFileLoggerChannel::log(ofLogLevel level, const string & module, const str } file << message << std::endl; } - diff --git a/libs/openFrameworks/utils/ofLog.h b/libs/openFrameworks/utils/ofLog.h index 77bf21fc3b4..83cb8c50a81 100644 --- a/libs/openFrameworks/utils/ofLog.h +++ b/libs/openFrameworks/utils/ofLog.h @@ -3,6 +3,7 @@ // Only private ofFile file; #include "ofFileUtils.h" #include +#include diff --git a/libs/openFrameworks/utils/ofThread.cpp b/libs/openFrameworks/utils/ofThread.cpp index 8977f3a5e23..f04e0796151 100644 --- a/libs/openFrameworks/utils/ofThread.cpp +++ b/libs/openFrameworks/utils/ofThread.cpp @@ -1,5 +1,6 @@ #include "ofThread.h" #include "ofLog.h" +#include #ifdef TARGET_ANDROID #include diff --git a/libs/openFrameworks/utils/ofTimerFps.cpp b/libs/openFrameworks/utils/ofTimerFps.cpp index ee6c09b548a..e9de7c05f3d 100644 --- a/libs/openFrameworks/utils/ofTimerFps.cpp +++ b/libs/openFrameworks/utils/ofTimerFps.cpp @@ -1,4 +1,5 @@ #include "ofTimerFps.h" +#include using namespace std::chrono; using namespace std::chrono_literals;