Skip to content

Instantly share code, notes, and snippets.

View moebiussurfing's full-sized avatar
🔥

moebiusSurfing moebiussurfing

🔥
View GitHub Profile
@moebiussurfing
moebiussurfing / ofxColorManager.cpp
Created July 31, 2019 00:17
ImGui color picker
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 |
@moebiussurfing
moebiussurfing / ofApp.cpp
Created November 13, 2019 18:00
ofDataPath set app path
string filepath = ofToDataPath("");
igl::readOBJ(filepath + "armadillo.obj", V, F);
//--------------------------------------------------------------
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;
@moebiussurfing
moebiussurfing / ofApp.h
Created November 28, 2019 00:14
create gui from class params post glitch
std::map<std::string, RenderPass::Ptr> passes;
ofxPanel gui;
void toggleListener(const void * sender, bool & value);
@moebiussurfing
moebiussurfing / cute & cool dark colors grid
Last active May 1, 2020 03:10
openFrameworks - example: cool colors grid
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);
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active May 18, 2020 06:07
openFrameworks - ofParameterGroup cast parameters from group callback
ofApp::Changed_params(ofAbstractParameter &e)
{
//bool
if (e.type() == typeid(ofParameter<bool>).name())
{
ofParameter<bool> b = e.cast<bool>();
if (name == "BANG_1")
{
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active February 11, 2020 08:52
openFrameworks - ofxSerializer OF types easy serialization
// 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");
# 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"
@moebiussurfing
moebiussurfing / ofParameterGroup_Changed_params
Last active August 20, 2021 01:09
openFrameworks - callback parameterGroup . ofParameterGroup / Changed_params / name = e.getName()
// .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);
@moebiussurfing
moebiussurfing / open file system dialog
Last active February 11, 2020 08:51
openFrameworks - open file system dialog // get texture from video
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{