00001 #ifndef _OF_UTIL 00002 #define _OF_UTIL 00003 00004 #include "ofConstants.h" 00005 00006 #ifdef TARGET_WIN32 // for ofLaunchBrowser 00007 #include <shellapi.h> 00008 #endif 00009 00010 00011 int ofNextPow2(int input); 00012 00013 void ofResetElapsedTimeCounter(); // this happens on the first frame 00014 float ofGetElapsedTimef(); 00015 int ofGetElapsedTimeMillis(); 00016 int ofGetFrameNum(); 00017 00018 int ofGetSeconds(); 00019 int ofGetMinutes(); 00020 int ofGetHours(); 00021 00022 unsigned long ofGetSystemTime( ); // system time in milliseconds; 00023 00024 int ofGetYear(); 00025 int ofGetMonth(); 00026 int ofGetDay(); 00027 int ofGetWeekday(); 00028 00029 void ofLaunchBrowser(string url); 00030 00031 void ofEnableDataPath(); 00032 void ofDisableDataPath(); 00033 string ofToDataPath(string path, bool absolute=false); 00034 00035 00036 //set the root path that ofToDataPath will use to search for files relative to the app 00037 //the path must have a trailing slash (/) !!!! 00038 void ofSetDataPathRoot( string root ); 00039 00040 string ofToString(double value, int precision = 7); 00041 string ofToString(int value); 00042 00043 string ofGetVersionInfo(); 00044 00045 void ofSaveScreen(string filename); 00046 void ofSaveFrame(); 00047 00048 vector<string> ofSplitString(const string & text, const string & delimiter); 00049 00050 //-------------------------------------------------- 00051 void ofSetLogLevel(int logLevel); 00052 void ofLog(int logLevel, string message); 00053 void ofLog(int logLevel, const char* format, ...); 00054 void ofSetConsoleColor(int color); 00055 void ofRestoreConsoleColor(); 00056 00057 #endif 00058 00059