← Back

ofxSimpleApp

github.com/Daandelange/ofxSimpleApp · @Daandelange
OF 0.12 Templates GUI Utilities

General-purpose application layout using ofxImGui. (not so simple)

1 1 Last commit 3mo ago Created 2y ago

README

ofxSimpleApp



A multi-purpose application layout for quickly setting up OpenFrameworks projects, powered by ofxImGui.

It aims to get you started quickly for both drafts and performance applications. It focusses on minimising the workflow for advanced use-cases, using simplicity where possible when it doesn't restrict the user. It is my personal ofApp base class that I use across many projects, I hope it's useful for you too. WIP.

Demo : ofxSimpleApp Minimal Demo Video of an ofxSimpleApp

Features



Requirements



You need the following addons for running the default configuration : Depending on your configuration's opt-ins, you'll need some extra addons with your project. Please refer to the Configuration section below for correspondance with the config flags.



Compatibility



Tested with OpenFrameworks 0.12 on macos.

Installation



Add ofxSimpleApp and ofxImGui to your project, then inherit your ofApp from ofxSimpleApp instead of ofBaseApp. Now you're ready to go for the minimal experience !

Configuration



Basically you need to configure which features you'd like to use by enabling their respective config flags, and sometimes add the required addons to your project.

Please refer to the examples for detailed options.

Config flagRequired ofxAddonsDescription
TestTestTest
ofxSA_XML_ENGINE=ofxSA_XML_ENGINE_TINYXMLofxXmlSettingsUse ofxXmlSettings as storage engine for saving sessions. (Unsupported)
ofxSA_XML_ENGINE=ofxSA_XML_ENGINE_PUGIXMLofxPugiXMLUse libPugiXML as storage engine for saving sessions.
ofxSA_XML_FILENAMEDefault filename for loading and saving sessions.
ofxSA_XML_FOLDERFolder where all session XML files are located.
ofxSA_GLOBAL_XML_FILENAMEDefault filename for loading and saving global application settings.
ofxSA_ENABLE_GLOBAL_XMLofxPugiXmlTo enable a global app settings savefile. Default=1, set to 0 to disable.
ofxSA_SYPHON_OUTPUTofxSyphonOutputs the canvas/ofAppWindow to Syphon. Macos only.
ofxSA_SYPHON_NAME_MAXLENMax length of a Syphon server. (verbose)
ofxSA_CANVAS_OUTPUT_ENABLE_None_Enables an fbo for rendering content, with GUI navigation and export/output.
ofxSA_CANVAS_OUTPUT_DEFAULT_WIDTHDefault canvas width.
ofxSA_CANVAS_OUTPUT_DEFAULT_HEIGHTDefault canvas height.
ofxSA_TIMELINE_ENABLE_None_Enables a timeline GUI + utility for offline or real-time playback.
ofxSA_TIMELINE_AUTOSTART
ofxSA_TIMELINE_SINGLETONEither to use the timeline as singleton. _(Unsupported set to false)_
ofxSA_TIMELINE_PAUSE_KEY(verbose)
ofxSA_TEXRECORDER_ENABLEofxFFmpegRecorderSupport for recording the ofAppWindow/canvas.
ofxSA_TEXRECORDER_DEFAULT_CODEC
ofxSA_TEXRECORDER_DEFAULT_FILENAME
ofxSA_TEXRECORDER_DEFAULT_OUTPUT_FOLDER
ofxSA_TEXRECORDER_USE_OFXFASTFBOREADERofxFastFboReaderEither to use ofxFastFboReader (faster) or Openframeworks GPU->CPU transfers.
DEFAULT_TEXTURE_RECORDER_CONTAINER_EXT(verbose)
ofxSA_TIME_MEASUREMENTS_ENABLEofxTimeMeasurementsEnables ofxTimeMeasurements integration for profiling/monitoring your ofApp.
ofxSA_TIME_MEASUREMENTS_TOGGLE_KEY OF_KEY_PAGE_DOWN(verbose)
ofxSA_TIME_MEASUREMENTS_TOGGLE_KEY_NAME(verbose)
ofxSA_TIME_MEASUREMENTS_AUTO_ENABLEDAuto-start on launch.
ofxSA_NDI_SENDER_ENABLEofxNDIOutputs the canvas/ofAppWindow to NDI.
ofxSA_NEWFRAME_FLAGGERHelper for detecting new frames. Also adds a Syphon option for only publishing new frames.
ofxSA_QUADWRAPPER_ENABLEofxQuadWarperEnables quad wrapping on the output canvas.
ofxSA_CANVAS_OUTPUT_EXTRA_STANDALONE_WINDOWAdds a 2ndary, standalone output window


ofxSaUserConfig



The ProjectGenerator erases project config settings / defines. For this reason, it's recommended to set them in a separate file (option 1). After using the PG on a project or example, you have to tell your compiler where this config file is by defining a macro constant : ofxSA_CONFIG_HEADER_FILE=ofxSAUserConfig will load ofxSAUserConfig.h. Refer to example-advanced/src/ofxSAUserConfig.h for a template. Alternative: ofxSA_CONFIG_HEADER_FILE="ofxSAUserConfig.h". (works better in XCODE)

In XCode projects add these to the "Other C Flags" and "Other C++ Flags" in your project settings :
-DofxSA_CONFIG_HEADER_FILE="ofxSAUserConfig.h"
-DofxAddons_ENABLE_IMGUI


In Qt-Creator, add this to your .qbs
of.defines: [
   'ofxSA_CONFIG_HEADER_FILE=ofxSAUserConfig',
   'ofxAddons_ENABLE_IMGUI', // if using ofxImGui
],


In Makefiles, add this to config.make :
PROJECT_DEFINES = ofxSA_CONFIG_HEADER_FILE=ofxSAUserConfig
PROJECT_DEFINES += ofxAddons_ENABLE_IMGUI


Examples



Alternative usage



ofxSimpleApp embeds a few useful classes, you can use them by including the appropriate files from your project. Maybe some addons like ofxImGui are required. Configuration applies.

Future ideas



Contributing



ofxSimpleApp tries to simplify the creative process working with OpenFrameworks. Many features and addon integrations are probably missing or to be improved. Contributions are welcome, feel free to open an issue, ask questions or submit a PR.

Bigup to all OpenFrameworks contributors and plugin makers !

License



MIT - Made by Daan de Lange

Get this addon

HTTPS
SSH