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
params.setName("myGroupParameters"); | |
params.add(separation.set("separation", 5, 1, 100)); | |
separationREF.makeReferenceTo(separation); | |
params.add(separationREF.set("separationREF", 5, 1, 100)); | |
//separationREF - separation are linked |
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
//check if a folder path exist and creates one if not | |
//many times when you try to save a file, this is not possible and do not happens bc the container folder do not exist | |
//-------------------------------------------------------------- | |
void CheckFolder(string _path) | |
{ | |
ofLogNotice(__FUNCTION__) << _path; | |
ofDirectory dataDirectory(ofToDataPath(_path, true)); |
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
//ofApp.h | |
ofTrueTypeFont font; | |
float fontSize; | |
//-------------------------------------------------------------- | |
void drawTextBoxed(string text, int x, int y, int alpha = 255) | |
{ | |
ofPushStyle(); | |
int pad = 20; |
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
//AddBigButton(bRandomizeIndex, 25);//index | |
AddBigButton(bRandomizeEditor, 25);//preset | |
AddBigToggle(PLAY_RandomizeTimer, 30); | |
//-- | |
//my custom ImGui helpers | |
////toggle ImGui button | |
////https://github.com/ocornut/imgui/issues/1537 | |
//-------------------------------------------------------------- |
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
HWND AppWindow = GetActiveWindow(); | |
SetWindowPos(AppWindow, HWND_TOPMOST, NULL, NULL, NULL, NULL, SWP_NOMOVE | SWP_NOSIZE); |
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
https://forum.openframeworks.cc/t/best-way-to-convert-between-euler-angles-and-quaternions-avoiding-gimbal-lock/34296/2 |
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
//ofxGui theme | |
//.cpp | |
//setup | |
setTheme_ofxGui(); | |
//ofApp.h | |
void setTheme_ofxGui() | |
{ | |
string pathFont = "assets/fonts/overpass-mono-bold.otf"; |
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
//https://forum.openframeworks.cc/t/can-iterate-though-all-ofxgui-elements/35047/11 | |
//https://forum.openframeworks.cc/t/its-posible-to-avoid-ofxgui-float-ofxslider-label-style-2-8e-15-to-0-000028/35953/2 | |
gui.setup(parameters); | |
//iterate through all elements of this gui | |
for (int i = 0; i < gui.getNumControls(); i++) { | |
auto control = gui.getControl(i); | |
//check if one of the elements might be a parameterGroup; i.e. parameter contains multiple items |
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
#pragma once | |
#include "ofMain.h" | |
//TODO: BUG: when enabled antialias 16 or RGBF32 recording goes grey...? | |
//windows ffmpeg screen recorder | |
#ifdef TARGET_WIN32 | |
#include "ofxFFmpegRecorder.h" | |
#include "ofxFastFboReader.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
// casting ofParameters | |
float v = static_cast<ofParameter<float>&>(parameter); | |
ofParameter<float> prop = static_cast<ofParameter<float>&>(parameter); | |
ofParameter<float> prop = parameter.cast<float>(); | |
//which internally does the static cast you are using now. | |
//https://forum.openframeworks.cc/t/ofparametergroup-best-practices/18752/8 | |
//-- |