This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofConstants.h" | |
#include "ofColor.h" | |
#include "ofPoint.h" | |
#include "ofMatrix4x4.h" | |
#include "ofRectangle.h" | |
#include "ofTypes.h" | |
/// \cond INTERNAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ofBase64.h | |
// | |
// Created by shugohirao on 2018/05/09. | |
// | |
#pragma once | |
#include "Poco/Base64Encoder.h" | |
namespace ofBase64 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------------------------------------- | |
// referrered to ofxSoundObjects | |
//-------------------------------------------------------------- | |
ofBuffer makeWavBuffer(const ofSoundBuffer &buff){ | |
// write a wav header | |
short myFormat = 1; // for pcm | |
int mySubChunk1Size = 16; | |
int bitsPerSample = 16; // assume 16 bit pcm | |
int myByteRate = buff.getSampleRate() * buff.getNumChannels() * bitsPerSample/8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ofSnippets.h | |
// | |
// Created by shugohirao on 2018/11/01~. | |
// | |
/*================================================== | |
setup | |
==================================================*/ | |
static void loadImg2Tex(ofTexture &tex, string path, float scale=1.0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void play(string soundPath, bool bOneShotLife=false){ | |
if(ofFile::doesFileExist(soundPath)){ | |
thread soundThread([=]{ | |
ofSoundPlayer sp; | |
sp.load(soundPath); | |
sp.setLoop(false); | |
cout<< "play talk"; | |
int t = ofGetElapsedTimeMicros(); | |
sp.play(); | |
while(sp.isLoaded() && sp.isPlaying()){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/ioctl.h> | |
#include <netinet/in.h> | |
#include <net/if.h> | |
#include <arpa/inet.h> | |
static string getIP(){ | |
int fd; | |
struct ifreq ifr; | |
fd = socket(AF_INET, SOCK_DGRAM, 0); | |
ifr.ifr_addr.sa_family = AF_INET; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ofxTsumami { | |
private: | |
float *target; | |
float radius;pp | |
float minVal, maxVal, initVal, pressedPct; | |
string name; | |
int res; | |
glm::vec2 pos, pressedPos; | |
bool bVertical; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wstringUtils.h | |
// https://gist.github.com/shiyuugohirao/5fb074dd346f96945136537bc6e2e7b9 | |
#pragma once | |
#include <stringapiset.h> | |
#include <WinBase.h> | |
#include <system_error> | |
#include <vector> | |
static std::wstring to_wstring(std::string const& src) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-------------------------------------------------- | |
# glslUtils | |
- https://gist.github.com/patriciogonzalezvivo/670c22f3966e662d2f83 | |
- https://github.com/ashima/webgl-noise | |
- https://thebookofshaders.com/ | |
- https://github.com/jamieowen/glsl-blend | |
--------------------------------------------------*/ | |
/*============================== Color ==============================*/ | |
vec3 rgb2hsb( in vec3 c ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofMain.h" | |
inline void setupIcon(string iconPath) { | |
// set window icon | |
HICON hWindowIcon = NULL; | |
HICON hWindowIconBig = NULL; | |
HWND hwnd = ofGetWin32Window(); | |
if (hWindowIcon != NULL) DestroyIcon(hWindowIcon); | |
if (hWindowIconBig != NULL) DestroyIcon(hWindowIconBig); |
OlderNewer