Skip to content

Instantly share code, notes, and snippets.

@shiyuugohirao
shiyuugohirao / ofSnippets.h
Last active May 5, 2019 19:40
my snippets for oepnFrameworks
//
// ofSnippets.h
//
// Created by shugohirao on 2018/11/01~.
//
/*==================================================
setup
==================================================*/
static void loadImg2Tex(ofTexture &tex, string path, float scale=1.0) {
@shiyuugohirao
shiyuugohirao / makeWavBuffer().cpp
Last active May 13, 2018 18:15
convert ofSoundBuffer to ofBuffer
//--------------------------------------------------------------
// 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;
@shiyuugohirao
shiyuugohirao / ofBase64.h
Last active April 13, 2019 04:31
openFrameworks + simple Base64 encoder
//
// ofBase64.h
//
// Created by shugohirao on 2018/05/09.
//
#pragma once
#include "Poco/Base64Encoder.h"
namespace ofBase64 {
@shiyuugohirao
shiyuugohirao / ofGraphics.h
Created March 5, 2018 21:55
ofColor::white のwarning対策 ### ADD ###追加
#pragma once
#include "ofConstants.h"
#include "ofColor.h"
#include "ofPoint.h"
#include "ofMatrix4x4.h"
#include "ofRectangle.h"
#include "ofTypes.h"
/// \cond INTERNAL