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
// 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
// TESTED ON nightly-build ver 0.8 (of_v20130813) in Visual Studio 2012 - Win64 | |
// MAKE APP ALWAYS ON TOP | |
HWND AppWindow = GetActiveWindow(); | |
SetWindowPos(AppWindow, HWND_TOPMOST, NULL, NULL, NULL, NULL, SWP_NOMOVE | SWP_NOSIZE); | |
// DISABLE FUNCTION DESCRIBED ABOVE | |
HWND AppWindow = GetActiveWindow(); |
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
/* | |
std::vector binding library for AngelScript | |
Copyright (c) 2004 Anthony "JM" Casteel | |
This software is provided 'as-is', without any express or implied | |
warranty. In no event will the authors be held liable for any | |
damages arising from the use of this software. | |
Permission is granted to anyone to use this software for any | |
purpose, including commercial applications, and to alter it and |
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; |
OlderNewer