#include "layers.h" svglayer::svglayer() { xo=0;yo=0; } svglayer::svglayer(string _f) { load(_f); } void svglayer::load(string _f){ //check if files exits svg.load(_f); printf("%i paths\n",svg.getNumPath()); for (int i=0;i0); } void svglayer::getCentre() { if (svg.getNumPath()>0) { xo=(ofGetWidth()-svg.getWidth())/2; yo=(ofGetHeight()-svg.getHeight())/2; } } void svglayer::draw(float a) { getCentre(); for (int i=0;i0.1) { svg.getPathAt(i).draw(xo,yo); } } } svglayer::~svglayer() { //dtor } imglayer::imglayer() { //img.setUseTexture(false); } imglayer::imglayer(string _f) { load(_f); } void imglayer::load(string _f){ bool success=img.loadImage(_f); printf("%s\n",success?"loaded":"not loaded"); } /* WTF is going on with the image drawing */ void imglayer::draw(float a) { //if (img.isAllocated()) if (!img.isUsingTexture()) img.setUseTexture(true); //has to be done from the main thread? still doesn't work img.draw(0,0,ofGetWidth(),ofGetHeight()); printf("drawing %f\n",ofGetElapsedTimef()); } void imglayer::draw(float a,unsigned char* controllers) { imglayer::draw(a); } imglayer::~imglayer() { //img.setUseTexture(false); //free texture }