Skip to content

Instantly share code, notes, and snippets.

View autoreload.pde
import java.io.File;
long lastTime = 0;
File f;
String[] data;
void setup() {
f = new File("e:/test.txt");
}
void draw() {
background(0);
View setupReciever.cpp
void OSC_TestApp::setupReciever(int portNum)
{
if (mReciever)
{
mReciever->close();
mReciever.release();
mReciever = make_unique<osc::ReceiverUdp>(portNum);
} else
{
@MartinBspheroid
MartinBspheroid / BullDog
Last active Aug 29, 2015
minimal autoreloading in Cinder it's called BullDog, LOL!!!!
View BullDog
/// 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;
@MartinBspheroid
MartinBspheroid / ciAngel_Bind_StdVector.h
Created Apr 8, 2014
std::vector bindings for AngelScript
View ciAngel_Bind_StdVector.h
/*
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
View gist:9920572
double PI = 4.0 * atan(1.0); // precise PI calculation
@MartinBspheroid
MartinBspheroid / gist:9900219
Created Mar 31, 2014
FMOD waveforms in Cinder
View gist:9900219
void Player::getWaveformPreview(vector <Vec2f> &preview, unsigned int size){
if (size == 0)
{
return;
}
preview.clear();
peak = 0;
void *waveData;
void *pointer2;
View gist:9742374
#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"
@MartinBspheroid
MartinBspheroid / gist:8902181
Last active Nov 16, 2022
openFrameworks hacks (win64)
View gist:8902181
// 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();
@MartinBspheroid
MartinBspheroid / gist:8782425
Created Feb 3, 2014
OF Hide console for VS2012
View gist:8782425
// in main.cpp
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
@MartinBspheroid
MartinBspheroid / vectorArrayManager2
Created Jan 25, 2014
Vector Array Manager 2 - C++11 compatible
View vectorArrayManager2
auto i = std::begin(inv);
while (i != std::end(inv)) {
// do some stuff
if (blah)
i = inv.erase(i);
else
++i;
}