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 | |
string path = GLOBAL_Path + "fonts/overpass-mono-bold.otf"; | |
ofFile file(path); | |
if (file.exists()) | |
{ | |
ofLogNotice("ofxSceneTEST") << "ofxGui theme: LOADED FONT FILE '" << path << "'"; | |
ofxGuiSetFont(path, 9); | |
} | |
else | |
{ |
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
ofFile file(path); | |
if (file.exists()) | |
{ | |
} | |
else | |
{ | |
ofLogError("ofApp") << "loadSettings '" << path << "' NOT FOUND!"; | |
} |
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 float position[] = {0.0f, 0.0f}; | |
ImGui::SliderFloat2("position", position, -1.0f, 1.0f); | |
static glm::vec3 myVector{0.0f, 0.0f, 0.0f}; | |
ImGui::SliderFloat3("myVector", (float*)&myVector, 0.0f, 1.0f); | |
static ImVec4 myImVector{1.0f, 1.0f, 1.0f, 1.0f}; | |
ImGui::SliderFloat4("myImVector", (float*)&myImVector, 0.0f, 1.0f); |
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/how-do-i-mix-the-alpha-channel-of-one-video-with-another/18771 | |
ofApp.h file | |
#pragma once | |
#include "ofMain.h" | |
class ofApp : public ofBaseApp{ |
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
// .h | |
ofParameterGroup params{"Params"}; | |
void Changed_Params(ofAbstractParameter &e); | |
bool DISABLE_Callbacks = false; // to avoid callback crashes or to enable only after setup() | |
// .cpp | |
// setup() | |
//params | |
SHOW_gui.set("SHOW_gui", 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
# rm all files | |
git rm -r --cached . | |
# add all files as per new .gitignore | |
git add . | |
# now, commit for new .gitignore to apply | |
git commit -m ".gitignore is now working" |
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
// Make vector. | |
std::vector<ofColor> palette = { ofColor::red }; | |
// Serialize it. | |
ofJson json = palette; | |
// Save it. | |
ofSaveJson("palette.json", json); | |
// Load it. | |
ofJson paletteJson = ofLoadJson("palette.json"); |
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::Changed_params(ofAbstractParameter &e) | |
{ | |
//bool | |
if (e.type() == typeid(ofParameter<bool>).name()) | |
{ | |
ofParameter<bool> b = e.cast<bool>(); | |
if (name == "BANG_1") | |
{ |
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
fontSmall.loadFont("Fonts/DIN.otf", 8 ); | |
ofxGuiSetFont( "Fonts/DIN.otf", 8 ); | |
ofxGuiSetDefaultWidth( 260 ); | |
// -------------------------------- | |
void draw() | |
{ | |
// + background | |
ofBackgroundGradient( ofColor(40,40,40), ofColor(0,0,0), OF_GRADIENT_CIRCULAR); |
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::map<std::string, RenderPass::Ptr> passes; | |
ofxPanel gui; | |
void toggleListener(const void * sender, bool & value); |