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
// in main.cpp | |
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"") | |
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 "cinder/app/AppNative.h" | |
#include "cinder/gl/gl.h" | |
#include "cinder\Capture.h" | |
#include "cinder\Surface.h" | |
#include "cinder/gl/Texture.h" | |
#include "cinder/MayaCamUI.h" | |
#include "cinder/Camera.h" | |
#include "cinder\Utilities.h" | |
#include "cinder/params/Params.h" | |
#include "cinder/ip/EdgeDetect.h" |
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 Player::getWaveformPreview(vector <Vec2f> &preview, unsigned int size){ | |
if (size == 0) | |
{ | |
return; | |
} | |
preview.clear(); | |
peak = 0; | |
void *waveData; | |
void *pointer2; |
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
double PI = 4.0 * atan(1.0); // precise PI calculation |
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
/// minimal autoreloading in cinder | |
/// it's called BullDog, LOL!!!! | |
struct wFile | |
{ | |
time_t time; | |
fs::path path; | |
std::function<void()> callback; | |
wFile(time_t t, fs::path p, std::function<void()> c) { | |
time = t; | |
path = p; |
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
for(vector<bloomPop>::iterator it = bloomPool.begin(); it != bloomPool.end();){ // loop through vector with iterator | |
it->update(); // update all objects in vector | |
if(it->time < 0){ /// if condition matches... | |
it = bloomPool.erase(it); // ..go to hell.. | |
}else{ | |
++it; // ..or keep counting and continue! | |
} | |
} |
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
float rand(vec2 co){ | |
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); | |
} |
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
auto i = std::begin(inv); | |
while (i != std::end(inv)) { | |
// do some stuff | |
if (blah) | |
i = inv.erase(i); | |
else | |
++i; | |
} |
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 OSC_TestApp::setupReciever(int portNum) | |
{ | |
if (mReciever) | |
{ | |
mReciever->close(); | |
mReciever.release(); | |
mReciever = make_unique<osc::ReceiverUdp>(portNum); | |
} else | |
{ |
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
import java.io.File; | |
long lastTime = 0; | |
File f; | |
String[] data; | |
void setup() { | |
f = new File("e:/test.txt"); | |
} | |
void draw() { | |
background(0); |
OlderNewer