From 4a43e83a3c4a43925a0a99ceba7a292a58bbccf0 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 10 Sep 2012 20:21:42 +0100 Subject: making it multiwindow --- liveengine/src/layers.cpp | 10 +++++++--- liveengine/src/layers.h | 6 ++++-- liveengine/src/main.cpp | 2 +- liveengine/src/playlist.cpp | 10 ++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) (limited to 'liveengine/src') diff --git a/liveengine/src/layers.cpp b/liveengine/src/layers.cpp index d2698ef..d7c7d77 100644 --- a/liveengine/src/layers.cpp +++ b/liveengine/src/layers.cpp @@ -8,7 +8,8 @@ svglayer::svglayer(string _f) load(_f); } -void svglayer::load(string _f){ +int svglayer::load(string _f){ + //check if files exits svg.load(_f); printf("%i paths\n",svg.getNumPath()); for (int i=0;i0) { + xo=(ofGetWidth()-svg.getWidth())/2; + yo=(ofGetHeight()-svg.getHeight())/2; + } + isLoaded= (svg.getNumPath()>0); } void svglayer::draw(float a) { diff --git a/liveengine/src/layers.h b/liveengine/src/layers.h index 11e50ab..2ebbd53 100644 --- a/liveengine/src/layers.h +++ b/liveengine/src/layers.h @@ -11,9 +11,11 @@ class layer virtual ~layer(){}; virtual void load(string _f){}; virtual void draw(float a){}; - virtual void draw(float a,unsigned char* controllers){ draw(a);}; + virtual void draw(float a,unsigned char* controllers){ draw(a);}; + virtual bool getLoaded(); protected: - private: + private: + bool isLoaded; }; class svglayer: public layer diff --git a/liveengine/src/main.cpp b/liveengine/src/main.cpp index 192f275..41470a2 100644 --- a/liveengine/src/main.cpp +++ b/liveengine/src/main.cpp @@ -6,7 +6,7 @@ int main( ){ ofAppGlutWindow window; - ofSetupOpenGL(&window, 1024,768, OF_FULLSCREEN); // <-------- setup the GL context + ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context //ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // this kicks off the running of my app diff --git a/liveengine/src/playlist.cpp b/liveengine/src/playlist.cpp index 3063595..af44940 100644 --- a/liveengine/src/playlist.cpp +++ b/liveengine/src/playlist.cpp @@ -39,9 +39,10 @@ void playlist::loadsvg(){ layers[XML.getAttribute("svglayer", "note", 0,i)]=new svglayer(XML.getAttribute("svglayer", "file", "",i)); } } - else printf("no SVG layers loaded!\n"); + else printf("no SVG layers loaded!\n"); + XML.popTag(); } - XML.popTag(); + } void playlist::loadimg(){ @@ -56,9 +57,10 @@ void playlist::loadimg(){ layers[XML.getAttribute("imglayer", "note", 0,i)]=new imglayer(XML.getAttribute("imglayer", "file", "",i)); } } - else printf("no IMG layers loaded!\n"); + else printf("no IMG layers loaded!\n"); + XML.popTag(); } - XML.popTag(); + } playlist::~playlist() -- cgit v1.2.3