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
glEnable(GL_POLYGON_SMOOTH); | |
glEnable(GL_LIGHTING); | |
glEnable(GL_LIGHT0); | |
glEnable(GL_DEPTH_TEST); | |
glEnable(GL_NORMALIZE); | |
glEnable(GL_COLOR_MATERIAL); | |
glDisable(GL_BLEND); | |
glPolygonMode(GL_BACK, GL_FILL ); | |
glEnable(GL_CULL_FACE); |
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 <uuid/uuid.h> | |
uuid_t uuid; | |
uuid_generate_random(uuid); | |
char s[37]; | |
uuid_unparse(uuid, s); | |
string idstr = s; | |
cout << idstr << endl; |
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
template<class T> | |
void findandreplace(T& source, const T& find, const T& replace) { | |
size_t j; | |
for (;(j = source.find( find )) != T::npos;) { | |
source.replace( j, find.length(), replace ); | |
} | |
} |
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
/**************************************** | |
ofxOSCReciver.h | |
****************************************/ | |
/* | |
Copyright (c) 2007-2009, Damian Stewart | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: |
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
static int strConv(const string &src, wstring &dst) | |
{ | |
iconv_t cd = iconv_open("UCS-4-INTERNAL", "UTF-8"); | |
if (cd == (iconv_t)-1) | |
return -1; | |
size_t src_length = strlen(src.c_str()); | |
int wlen = (int)src_length/3; | |
size_t buf_length = src_length + wlen; | |
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::copy(vector.begin(), vector.end(), std::inserter(deque, deque.end())); |
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 <Rpc.h> | |
#pragma comment(lib, "Rpcrt4.lib") | |
static string get_uuid() | |
{ | |
string rtn; | |
UUID uuid; | |
UuidCreate(&uuid); | |
char *str; | |
UuidToStringA(&uuid, (RPC_CSTR*)&str); |
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
// | |
// BoxFIR.h | |
// FilteringTrial | |
// | |
// Created by Akira on 5/18/13. | |
// | |
// | |
#ifndef FilteringTrial_BoxFIR_h | |
#define FilteringTrial_BoxFIR_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
static void GetGLVersion(int* major, int* minor) | |
{ | |
// for all versions | |
char* ver = (char*)glGetString(GL_VERSION); // ver = "3.2.0" | |
*major = ver[0] - '0'; | |
if( *major >= 3) | |
{ | |
// for GL 3.x | |
glGetIntegerv(GL_MAJOR_VERSION, major); // major = 3 |
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 testApp::setup() | |
{ | |
ofSetWindowPosition(0, 0); | |
sender_dist.setHighWaterMark(2); | |
sender_dist.bind(string("tcp://*:") + ofToString(9999)); | |
int fishType = 3; | |
int deviceID = 5; | |
testTex.loadImage("imgs/testTex.jpg"); |
OlderNewer