View ofApp.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
std::map<std::string, RenderPass::Ptr> passes; | |
ofxPanel gui; | |
void toggleListener(const void * sender, bool & value); |
View ofxSerialize app window settings save load
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 ofxFontAnimator::saveWindow() | |
{ | |
//save window settings | |
ofWindowSettings AppWindow; | |
AppWindow.setPosition(glm::vec2(ofGetWindowPositionX(), ofGetWindowPositionY())); | |
AppWindow.setSize(ofGetWindowSize().x, ofGetWindowSize().y); | |
AppWindow.windowMode = ofGetCurrentWindow()->getWindowMode(); | |
ofJson j; |
View ofApp.cpp
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
string filepath = ofToDataPath(""); | |
igl::readOBJ(filepath + "armadillo.obj", V, F); |
View ofxColorManager.cpp
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 ImVec4 color; | |
color.x = color_backGround.get().r; | |
color.y = color_backGround.get().g; | |
color.z = color_backGround.get().b; | |
color.w = color_backGround.get().a; | |
// squared box | |
ImGuiColorEditFlags colorEdiFlags = | |
ImGuiColorEditFlags_NoSmallPreview | | |
ImGuiColorEditFlags_NoTooltip | |
View cpp
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!"; | |
} |
View gist:73953e47d02c7e2bbdb484c42b80d390
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); |
View open file system dialog
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{ |
View ofApp.cpp
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"); |
View ofApp.cpp
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 | |
{ |
View ofApp.cpp
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 ofxFontAnimator::refreshGui_AllColors() | |
{ | |
//gui_All_Colors.minimizeAll(); | |
//collapse groups | |
auto &gAll = gui_All_Colors.getGroup("ALL COLORS"); | |
auto &gF = gAll.getGroup("FONTS"); | |
auto &gBg = gAll.getGroup("BACKGROUNDS"); | |
auto &gGr = gBg.getGroup("GRADIENT BACKGROUND"); |
OlderNewer