Pages: [1]
Author Topic: ofxLogger & ofxAppUtils  (Read 1045 times)
danomatika
robotcowboy industries

Posts: 109

Gravatar


WWW
ofxLogger & ofxAppUtils
« on: April 18, 2011, 12:32:01 AM »

Here's a pair of utility addons I'm throwing out there. As always feel free to fork and make pull requests via Github.

ofxLogger

As my advanced logger was causing problems within OF 007 and has been removed for now, I've spun it out as an addon for use and testing. I have used it in a few projects and not had any problems so far. You're fine as long as you don't try to call it in a destructor since the main logger object is in a singleton object and, as such, you can never know when it will be destroyed.

https://github.com/danomatika/openFrameworks

This is a wrapper around the Poco::Logger which provides:
  • C++ stream operator (automatic string conversion, no ofToString needed!)
  • handy log level named calls: ofxLog, ofxLogVerbose, ofxLogWarning, etc
  • file logging, including automatic trimming and rotation
  • switchable log channels between console and/or file (could be extended for logging over a socket, etc)
  • automatic header with timestamp, millis, frame num
  • user level log topics for log filtering

You use it like so:

ofxLog() << "a string" << 100 << 20.234f;

Additionally, there is an ofxBitmapString which provides a C++ ostream interface to ofDrawBitmap string. I grew tired of having to add a stringstream every time I wanted to draw some text, so this does it for you.

Use like so:

ofxBitmapString(10, 10) << "a string" << 100 << 20.234f;

ofxAppUtils

This is a bunch of OpenFrameworks utility code from my last project that might be useful.

https://github.com/danomatika/ofxAppUtils

ofxAppUtils is a set utilites for application development including:

  • ofxApp: an ofBaseApp extension with built in screen scaling, projection mapping transforms, quad warping, and an ofxControlPanel
  • ofxScene: a mini ofBaseApp for writing stand alone scenes
  • ofxSceneManager: handles a list of scenes using a std::map
  • ofxTransformer: open gl transformer for origin translation, screen scaling, mirroring, and quad warping
  • ofxQuadWarper: an open gl matrix quad warper (useful for oblique projection mapping)
  • ofxTimer: a simple millis timer
Logged

danomatika
robotcowboy industries

Posts: 109

Gravatar


WWW
Re: ofxLogger & ofxAppUtils
« Reply #1 on: November 03, 2011, 07:55:56 AM »

I updated ofAppUtils so that you use the ofBaseApp callbacks functions directly (as opposed to the old method of renaming them). Another big update is that *all* the ofBaseApp functions are handled down to the scene level which should make combining several apps into a multiscene app relatively trivial.
Logged

danomatika
robotcowboy industries

Posts: 109

Gravatar


WWW
Re: ofxLogger & ofxAppUtils
« Reply #2 on: November 23, 2011, 09:44:13 PM »

ofxAppUtils has been updated again:
  • ofxControlPanel is now optional, add a define to the build: OFX_APP_UTILS_NO_CONTROL_PANEL
  • ofxApp built in control panel auto draw can now be disabled and the panel drawn manually
  • ofxApp render area auto aspect and auto centering now *finally* work correctly
  • added auto fps string rendering options: enable/disable, set text color, draw manually
  • ofxTimer: added resetAlarm and copy operations
  • added ofxParticle & ofxParticleSystem classes

Also, ofxAppUtils is now licensed under the BSD Simplified license.
Logged

danomatika
robotcowboy industries

Posts: 109

Gravatar


WWW
Re: ofxLogger & ofxAppUtils
« Reply #3 on: November 26, 2011, 11:10:44 PM »

Yet another update:
  • added ofxBitmapString (ofDrawBitmapString stream wrapper) from ofxLogger
  • auto transforms can now be disabled and performed manually
  • quad warp editor is finally 1:1 (now more dragging from screen corners)
  • added ability to disable auto sceneManager update and draw calls
Logged

bazitov

Posts: 29

Gravatar


Re: ofxLogger & ofxAppUtils
« Reply #4 on: May 09, 2012, 10:01:16 PM »

Hi,

I have a simple question about ofxScene.

My case is that I have bunch of images and bunch of images calculated and updated in the main testApp.h,
and my question is how to draw these images in a separate scene.

I can see that I have access to the images just here:

    MaskingScene(testApp &app) : ofxScene((ofxApp&) app, "Particles") {

if referenced as - app.my_images, but not in the draw method of the scene.

Thank you in advance!
Miro
Logged

Pages: [1]
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2011, Simple Machines

viagra priser