SVN-fs-dump-format-version: 2
UUID: 0457777e-be4a-0410-a59e-cd2fa5f2afb7
Revision-number: 0
Prop-content-length: 56
Content-length: 56
K 8
svn:date
V 27
2008-04-13T10:18:52.907662Z
PROPS-END
Revision-number: 1
Prop-content-length: 143
Content-length: 143
K 7
svn:log
V 44
setting up addons repos based on 005 release
K 10
svn:author
V 4
theo
K 8
svn:date
V 27
2008-04-13T11:01:22.605597Z
PROPS-END
Node-path: branches
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: tags
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofAddons.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1311
Text-content-md5: 2d9d9a7041e3d87384cf3052a0dfdc48
Content-length: 1321
PROPS-END
// here is where you paste any "add me to ofAddons.h" code
// for the addon you want to add
// you will also need to follow the other steps
// like adding the library linking paths, etc,etc.
//-------------------------------------------- openCV
#ifdef OF_ADDON_USING_OFXOPENCV
#include "ofxCvMain.h"
#endif
//-------------------------------------------- obj loader
#ifdef OF_ADDON_USING_OFXOBJLOADER
#include "ofxObjLoader.h"
#endif
//-------------------------------------------- dir list
#ifdef OF_ADDON_USING_OFXDIRLIST
#include "ofxDirList.h"
#endif
//-------------------------------------------- vector math
#ifdef OF_ADDON_USING_OFXVECTORMATH
#include "ofxVectorMath.h"
#endif
//-------------------------------------------- network
#ifdef OF_ADDON_USING_OFXNETWORK
#include "ofxNetwork.h"
#endif
//-------------------------------------------- vector graphics
#ifdef OF_ADDON_USING_OFXVECTORGRAPHICS
#include "ofxVectorGraphics.h"
#endif
//-------------------------------------------- OSC
#ifdef OF_ADDON_USING_OFXOSC
#include "ofxOsc.h"
#endif
//-------------------------------------------- ofthread
#ifdef OF_ADDON_USING_OFXTHREAD
#include "ofxThread.h"
#endif
//-------------------------------------------- ofXML
#ifdef OF_ADDON_USING_OFXXMLSETTINGS
#include "ofxXmlSettings.h"
#endif
Node-path: trunk/addons/ofxDirList
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxDirList/doc
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxDirList/doc/Instructions.txt
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1193
Text-content-md5: 63b5b16d1f8c5076192ce5b379df06a5
Content-length: 1203
PROPS-END
ofDirList - July 18th 2007 - by Theodore Watson
Installation:
1 Copy ofDirList.h and ofDirList.cpp to your ofAddons folder.
2 Add #include "ofDirList.h" to ofAddons.h
3 Add ofDirList.h and ofDirList.cpp to IDE
Changes:
1 Now takes string type as argument
2 Fixed wildcard * for allowing all extensions
3 Extensions are now case insensitive
4 reset() function to clear extension list
Example Usage:
////////////////////////////////////////////////
ofDirList DIR;
//Allow only certain files
//by specifying extension
//Extensions are not case sensitive
//so 'mov' allows both 'mov' and 'MOV'
//To include all files either don't
//call allowExt or specify the wildcard
// '*'
DIR.allowExt("mov");
DIR.allowExt("jpg");
//if you wish to keep the console quiet
DIR.setVerbose(false);
//now lets list the directory
//listDir returns number of files found
//with the specified extension
int numFiles = DIR.listDir("images/");
//you can now iterate through the files as you like
for(int i = 0; i < numFiles; i++){
printf("name is %s - path is %s \n", DIR.getName(i), DIR.getPath(i) );
}
//if you want to reuse ofDirList for different files
//call reset(); to clear the allowed extensions
Node-path: trunk/addons/ofxDirList/example
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxDirList/example/src
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxDirList/example/src/main.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 351
Text-content-md5: 391569a9e3d138ab580b7c9e86ae35d4
Content-length: 361
PROPS-END
#include "ofMain.h"
#include "testApp.h"
//========================================================================
int main( ){
ofSetupOpenGL(600,320, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp(new testApp());
}
Node-path: trunk/addons/ofxDirList/example/src/testApp.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1280
Text-content-md5: 9be8d5d944db07580c029e3f77f44d73
Content-length: 1290
PROPS-END
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
ofBackground(127,127,127);
}
//--------------------------------------------------------------
void testApp::update(){
}
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(0xffffff);
ofDrawBitmapString("this app doesn't do anything :) \nIt's just a test to see if many of the common addons \ncan work in the same place w/ no include \nor linking issues...\n\nif you're seeing this, it's good!", 100,100);
}
//--------------------------------------------------------------
void testApp::keyPressed (int key){
}
//--------------------------------------------------------------
void testApp::keyReleased (int key){
}
//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
}
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
}
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
}
//--------------------------------------------------------------
void testApp::mouseReleased(){
}
Node-path: trunk/addons/ofxDirList/example/src/testApp.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1094
Text-content-md5: 8ef762b0b26c3ccaf83675c265db716b
Content-length: 1104
PROPS-END
#ifndef _TEST_APP
#define _TEST_APP
#define OF_ADDON_USING_OFXOPENCV
#define OF_ADDON_USING_OFXOBJLOADER
#define OF_ADDON_USING_OFXDIRLIST
#define OF_ADDON_USING_OFXVECTORMATH
#define OF_ADDON_USING_OFXNETWORK
#define OF_ADDON_USING_OFXVECTORGRAPHICS
#define OF_ADDON_USING_OFXOSC
#define OF_ADDON_USING_OFXTHREAD
#define OF_ADDON_USING_OFXXMLSETTINGS
#include "ofMain.h"
#include "ofAddons.h"
class testApp : public ofSimpleApp{
public:
void setup();
void update();
void draw();
void keyPressed (int key);
void keyReleased (int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased();
// we don't actually use these
// just checking to see if they
// all work in the same place :)
ofxCvGrayscaleImage cvGray;
ofxObjLoader obj;
ofxDirList dirList;
ofxVec2f p;
ofxTCPClient client;
ofxTCPServer server;
ofxOscSender osc_sender;
ofxThread thread;
ofxXmlSettings settings;
};
#endif
Node-path: trunk/addons/ofxDirList/install.xml
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 1103
Text-content-md5: 65265e8e2b025477975484f57ca89c9c
Content-length: 1113
PROPS-END
0.01
theo watson
//--------------------------------------------- dir list
#ifdef OF_ADDON_USING_OFXDIRLIST
#include "ofxDirList.h"
#endif
../../../addons/ofxDirList/src/ofxDirList.h
../../../addons/ofxDirList/src/ofxDirList.cpp
../../../addons/ofxDirList/src
Node-path: trunk/addons/ofxDirList/src
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxDirList/src/ofxDirList.cpp
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 4828
Text-content-md5: aa1dcfb1e412c9b7169b17bf5aa6d482
Content-length: 4838
PROPS-END
#include "ofxDirList.h"
//----------------------------------------------------------
ofxDirList::ofxDirList()
{
allowedFileExt = new char*[OF_DL_MAX_EXTS];
nameArray = new char*[OF_DL_MAX_RESULTS];
pathArray = new char*[OF_DL_MAX_RESULTS];
for(int k = 0; k < OF_DL_MAX_EXTS; k++)
allowedFileExt[k] = new char[OF_DL_EXT_SIZE];
for(int k = 0; k < OF_DL_MAX_RESULTS; k++){
nameArray[k] = new char[OF_DL_FILELEN];
pathArray[k] = new char[OF_DL_FILELEN];
}
//an allowCount of 0 means no extensions are to be checked,
allowCount = 0;
verbose = true;
}
//----------------------------------------------------------
void ofxDirList::reset(){
allowCount = 0;
}
//----------------------------------------------------------
void ofxDirList::setVerbose(bool _verbose)
{
verbose = _verbose;
}
//----------------------------------------------------------
bool ofxDirList::allowExt(string ext)
{
if(allowCount >= OF_DL_MAX_EXTS -1){if(verbose)printf("ofxDirList - no of extensions > OF_DL_MAX_EXTS\n"); return false; }
if(ext.length() >= OF_DL_EXT_SIZE){if(verbose)printf("ofxDirList - extension is > OF_DL_EXT_SIZE\n"); return false; }
sprintf(allowedFileExt[allowCount], "%s", (char *)ext.c_str());
allowCount++;
return true;
}
//----------------------------------------------------------
string ofxDirList::getName(int pos)
{
if(pos >= count) return 0;
return string(nameArray[pos]);
}
//----------------------------------------------------------
string ofxDirList::getPath(int pos)
{
if(pos >= count) return 0;
return string(pathArray[pos]);
}
//----------------------------------------------------------
int ofxDirList::listDir(string directory)
{
directory = ofToDataPath(directory);
DIR *dir;
char *extension;
struct dirent *entry;
bool skip = false;
//if no dir is specified look in same folder as executable
if(directory.length() == 0) dir = opendir(".");
else dir = opendir(directory.c_str());
if (dir == NULL){
if(verbose)printf("ofxDirList - error opening directory\n");
return 0;
}
count = 0;
while ((entry = readdir(dir)) != NULL && count < OF_DL_MAX_RESULTS)
{
//make sure we are not looking at ./ or ../ on unix based systems
char * pch;
pch = (char*) memchr ((char *)entry->d_name, '.', 1);
if(pch != NULL) continue;
//by default we don't skip files unless we are checking extensions
skip = false;
if(allowCount > 0)
{
//we will skip this files unless it has an allowed extension
skip = true;
for(int i = 0; i < allowCount; i++)
{
//if the wildecard * (42) has been entered for an ext type then don't check any extensions
if( allowedFileExt[i][0] == 42){ skip = false; break; }
//get the lengths of both the filename and the extention
int extLen = strlen(allowedFileExt[i]);
int fileLen = strlen(entry->d_name);
//the extension has to be shorter than the filename
if(extLen >= fileLen) continue;
//lets check if there is a fullstop/peroid where we expect it to be
if(entry->d_name[fileLen-extLen-1] != '.') continue;
//so now lets see if the extensions match
bool checkExt = true;
for(int j = 0; j < extLen; j++)
{
if( tolower(entry->d_name[fileLen-j]) != tolower(allowedFileExt[i][extLen-j]) ){checkExt = false; break; }
}
//they do match so we don't skip this entry
if(checkExt == true){ skip = false; break;}
}
}
if(skip) continue;
//if the file is too long for our string
if(strlen(entry->d_name) >= OF_DL_FILELEN)
{
if(verbose)printf("ofxDirList - file name > OF_DL_FILELEN\n");
return 0;
}
//Otherwise lets copy it to our results list
//MAKE OUR PATH ARRAY
//lets check that the full path can fit in the char * we have for it
if(OF_DL_FILELEN > strlen(entry->d_name) + directory.length() )
{
//if some muppet forgot the trailing slash lets add it for them
if(directory.substr(directory.length()-1) != "/") sprintf(pathArray[count],"%s/%s",directory.c_str(),entry->d_name);
else sprintf(pathArray[count],"%s%s",directory.c_str(),entry->d_name);
}
else
{
if(verbose)printf("ofxDirList - path %s too long for string",entry->d_name);
continue;
}
//MAKE OUR NAME ARRAY
//lets check that the filename can fit in the char * we have for it
if(OF_DL_FILELEN > strlen(entry->d_name) )sprintf(nameArray[count],entry->d_name);
else
{
if(verbose)printf("ofxDirList - path %s too long for string",entry->d_name);
continue;
}
if(verbose)printf("ofxDirList - listing %s \n", nameArray[count]);
count++;
}
if(verbose)printf("ofxDirList - listed %i files in %s\n", count, directory.c_str());
return count;
}
//Clean up
//----------------------------------------------------------
ofxDirList::~ofxDirList()
{
delete pathArray;
delete nameArray;
delete allowedFileExt;
}
Node-path: trunk/addons/ofxDirList/src/ofxDirList.h
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 8617
Text-content-md5: 6a35f4bd809dfc1ad97e7ec03cde29f8
Content-length: 8627
PROPS-END
#ifndef OFX_DIRLIST
#define OFX_DIRLIST
/************************************************************
OpenFrameworks Library
File: ofxDirList.h
Description: List the contents of a directory
Notes: Now takes string arguements and starts at the data/ folder level
Last Modified: 2007.07.18
Creator: Theodore Watson
************************************************************/
#include "ofMain.h"
#ifdef TARGET_WIN32
#include
#include
#include
#else
#include
#endif
#define OF_DL_MAX_RESULTS 200
#define OF_DL_FILELEN 512
#define OF_DL_MAX_EXTS 100
#define OF_DL_EXT_SIZE 64
class ofxDirList{
public:
ofxDirList();
~ofxDirList();
void setVerbose(bool _verbose);
string getName(int pos);
string getPath(int pos);
void reset(); // resets extension list
bool allowExt(string ext); // returns true if ext is accepted
int listDir(string directory); // returns number of files found
private:
char ** allowedFileExt;
char ** nameArray;
char ** pathArray;
int allowCount;
int count;
bool verbose;
};
// this is WIN32 dirent included in here for ease of usage
// since windows doesn't have dirent by default. this is just a wrapper....
// because we haven't written win32 version of the same code
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
/*
* dirent.h - dirent API for Microsoft Visual Studio
*
* Copyright (C) 2006 Toni Ronkko
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* ``Software''), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef TARGET_WIN32
#include
#include
#include
#include
typedef struct dirent {
/* name of current directory entry (a multi-byte character string) */
char d_name[MAX_PATH + 1];
/* file attributes */
WIN32_FIND_DATA data;
} dirent;
typedef struct DIR {
/* current directory entry */
dirent current;
/* is there an un-processed entry in current? */
int cached;
/* file search handle */
HANDLE search_handle;
/* search pattern (3 = zero terminator + pattern "\\*") */
TCHAR patt[MAX_PATH + 3];
} DIR;
static DIR *opendir (const char *dirname);
static struct dirent *readdir (DIR *dirp);
static int closedir (DIR *dirp);
/* use the new safe string functions introduced in Visual Studio 2005 */
#if defined(_MSC_VER) && _MSC_VER >= 1400
# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
#else
# define STRNCPY(dest,src,size) strncpy((dest),(src),(size))
#endif
/*
* Open directory stream DIRNAME for read and return a pointer to the
* internal working area that is used to retrieve individual directory
* entries.
*/
static DIR*
opendir(
const char *dirname)
{
DIR *dirp;
assert (dirname != NULL);
assert (strlen (dirname) < MAX_PATH);
/* construct new DIR structure */
dirp = (DIR*) malloc (sizeof (struct DIR));
if (dirp != NULL) {
TCHAR *p;
/* prepare search pattern */
#ifdef _UNICODE
/* convert directory name to wide character string */
MultiByteToWideChar(
CP_ACP, /* code page */
0, /* conversion flags */
dirname, /* mb-string to convert */
-1, /* length of mb-string */
dirp->patt, /* wc-string to produce */
MAX_PATH); /* max length of wc-string */
dirp->patt[MAX_PATH] = '\0';
/* append search pattern to directory name */
p = wcschr (dirp->patt, '\0');
if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
*p++ = '\\';
}
*p++ = '*';
*p = '\0';
#else /* !_UNICODE */
/* take directory name... */
STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
dirp->patt[MAX_PATH] = '\0';
/* ... and append search pattern to it */
p = strchr (dirp->patt, '\0');
if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
*p++ = '\\';
}
*p++ = '*';
*p = '\0';
#endif /* !_UNICODE */
/* open stream and retrieve first file */
dirp->search_handle = FindFirstFile (dirp->patt, &dirp->current.data);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* invalid search pattern? */
free (dirp);
return NULL;
}
/* there is an un-processed directory entry in memory now */
dirp->cached = 1;
}
return dirp;
}
/*
* Read a directory entry, and return a pointer to a dirent structure
* containing the name of the entry in d_name field. Individual directory
* entries returned by this very function include regular files,
* sub-directories, pseudo-directories "." and "..", but also volume labels,
* hidden files and system files may be returned.
*/
static struct dirent *
readdir(
DIR *dirp)
{
assert (dirp != NULL);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* directory stream was opened/rewound incorrectly or it ended normally */
return NULL;
}
/* get next directory entry */
if (dirp->cached != 0) {
/* a valid directory entry already in memory */
dirp->cached = 0;
} else {
/* read next directory entry from disk */
if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) {
/* the very last file has been processed or an error occured */
FindClose (dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
return NULL;
}
}
/* copy directory entry to d_name */
#ifdef _UNICODE
/* convert entry name to multibyte */
WideCharToMultiByte(
CP_ACP, /* code page */
0, /* conversion flags */
dirp->current.data.cFileName, /* wc-string to convert */
-1, /* length of wc-string */
dirp->current.d_name, /* mb-string to produce */
MAX_PATH, /* max length of mb-string */
NULL, /* use sys default character */
NULL); /* don't care */
dirp->current.d_name[MAX_PATH] = '\0';
#else /* !_UNICODE */
/* copy as a multibyte character string */
STRNCPY (dirp->current.d_name, dirp->current.data.cFileName, sizeof(dirp->current.d_name));
dirp->current.d_name[MAX_PATH] = '\0';
#endif /* !_UNICODE */
return &dirp->current;
}
/*
* Close directory stream opened by opendir() function. Close of the
* directory stream invalidates the DIR structure as well as any previously
* read directory entry.
*/
static int
closedir(
DIR *dirp)
{
assert (dirp != NULL);
/* release search handle */
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
FindClose (dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
}
/* release directory handle */
free (dirp);
return 0;
}
#endif
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
#endif
Node-path: trunk/addons/ofxNetwork
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxNetwork/docs
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxNetwork/docs/Instructions.txt
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 3317
Text-content-md5: 715cab92bc022e75dde10ad7945fa82e
Content-length: 3327
PROPS-END
ofTCPServer & ofTCPClient install instructions
NOTE: ofTCPServer and ofTCPClient require ofThread - please checkout ofThread first and follow the instructions to install ofThread before installing ofTCPClient and ofTCPServer.
NOTE: Windows users will need to add ws2_32.lib to your project. This is part of the Windows SDK.
For Codewarrior it is here: C:/Program Files/Metrowerks/CodeWarrior/Win32-x86 Support/Libraries/Win32SDK/
For Visual Studio it is here C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Lib
For Dev-C++ it is here C:/Dev-Cpp/lib -- for Dev-C++ it is called libws2_32.a
It is strongly encourage to copy the lib to your openFrameworks libs/ folder and then add to your project.
+++++ Step 0 ++++++
Copy ofTCPServer.h and .cpp and ofTCPClient.h and .cpp to libs/ofAddons/communication/
+++++ Step 1 ++++++
Duplicate a project twice and rename one tcpServerExample and tcpClientExample replace testApp.h testApp.cpp and main.cpp with the replacement for each example.
+++++ Step 2 ++++++
Drag the ofTCPServer and ofTCPClient files from libs/ofAddons/communication/
into your project. As well as ofAddons.h from libs/ofAddons/
in ofAddons.h you should have:
#ifndef _OF_ADDONS_H_
#define _OF_ADDONS_H_
//--------------------------
// utils
#include "ofThread.h"
//--------------------------
// communication
#include "ofTCPServer.h"
#include "ofTCPClient.h"
//--------------------------
// graphics
//--------------------------
// app
//--------------------------
// audio
//--------------------------
// video
#endif
+++++ Step 3 ++++++
Add the folder tcpUdpManager to your main libs folder.
Then drag folder into both projects.
+++++ Step 4 ++++++
in of Constants.h change the line
// then the the platform specific includes:
#ifdef TARGET_WIN32
To:
// then the the platform specific includes:
#ifdef TARGET_WIN32
//this is for TryEnterCriticalSection
//http://www.zeroc.com/forums/help-center/351-ice-1-2-tryentercriticalsection-problem.html
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x400
#endif
+++++ Step 5 ++++++
To run the demo app make sure in ofConstants.h you have
using namespace std;
#include
#include //for ostringsream
#include //for setprecision
+++++ Step 6 ++++++
Also to run the demo make sure you have in ofUtils.cpp
//--------------------------------------------------
string ofToString(double value, int precision){
stringstream sstr;
sstr << fixed << setprecision(precision) << value;
return sstr.str();
}
//--------------------------------------------------
string ofToString(int value){
stringstream sstr;
sstr << value;
return sstr.str();
}
And also in in ofUtils.h:
string ofToString(double value, int precision = 7);
string ofToString(int value);
+++++ Step 7 ++++++
Add ofSleepMillis()
add the line bellow to ofAppRunner.h:
void ofSleepMillis(int millis);
and add the code bellow to ofAppRunner.cpp
//--------------------------------------
void ofSleepMillis(int millis){
#ifdef TARGET_WIN32
Sleep(millis); //windows sleep in milliseconds
#else
usleep(millis * 1000); //mac sleep in microseconds - cooler :)
#endif
}
+++++ Step 8 ++++++
Make sure you add the fonts needed and specify the corrent path to their location.
Node-path: trunk/addons/ofxNetwork/examples
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxNetwork/examples/TCPClientExample
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxNetwork/examples/TCPClientExample/data
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxNetwork/examples/TCPClientExample/data/type
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10
PROPS-END
Node-path: trunk/addons/ofxNetwork/examples/TCPClientExample/data/type/frabk.ttf
Node-kind: file
Node-action: add
Prop-content-length: 59
Text-content-length: 152700
Text-content-md5: e130d119682ecb567748343bf7f263b0
Content-length: 152759
K 13
svn:mime-type
V 24
application/octet-stream
PROPS-END
0DSIG9 <