← Back

ofxMTAppFramework

github.com/c-mendoza/ofxMTAppFramework · @c-mendoza
OF 0.12 Templates Utilities

An alternative way to create apps with openFrameworks

9 0 Last commit 5mo ago Created 9y ago

Branches ahead of master

These branches have commits not yet on master — could be unmerged fixes or work in progress worth a look.

ofxImGui_latest 1 commit ahead · last commit 3y ago
templated-app 1 commit ahead · last commit 8y ago
ofXXXXAppWindow_subclass 2 commits ahead · last commit 9y ago

README

ofxMTAppFramework



The ofxMTAppFramework is a set of classes that facilitate the creation of applications that require a more complex set of UI behaviors than those provided by the standard ofApp application. With the ofxMTAppFramework you can:

Easily create nested graphical views, each of which have their own set of mouse and keyboard events. View focus, local drawing coordinates, local mouse coordinates, hit testing, etc, is all handled for you behind the scenes. Think UIView/NSView or Flash Component-like behavior. Get "save" and "save as" behaviors for your applications, with dialog boxes, accessible via keyboard shortcuts. Use a persistent app preferences system. By default it stores app window size and position, but it can very easily be extended to remember custom app properties of any type. Should your app start on full screen, or should it be windowed? Should it run on debug mode, or presentation mode? Should it automatically load the last file that was saved, or should it create a new one on start? Easily manage and store these states with app preferences.

The goal of the framework is to provide useful app behavior needed in any non-trivial OF application without writing much boilerplate code, and yet still be lightweight enough to be useful as a prototyping framework.

Architecture

Model-View (no Controller) design. The View controls itself, the Model may control data-related logic. Document-based application, where only a single document is open at a given time. Main classes:

Design

The framework is inspired by the Cocoa approach to windows, views, and documents. Unlike Cocoa, which uses a Model-View-Controller paradigm, ofxMTAppFramework uses a "Model-View" (no Controller) design pattern, where the logic for controlling the view is in the view class itself. This is more amenable to the type of applications made with OpenFrameworks, which typically have a single view for the app data, and reduces the number of classes where the application is distributed to.

The workflow in ofxMTAppFramework is a bit different than in the traditional OF app, where a single class represents the app, the data (model), and the output (view). Given that most OF applications are output-oriented, most of the programming is done on the Views.

Get this addon

HTTPS
SSH