pakt21

#include "cinder/app/AppBasic.h"
#include "cinder/cairo/Cairo.h"

using namespace ci;
using namespace ci::app;
using namespace std;

const int WIDTH= 640;
const int HEIGHT= 480;

class pakt21App : public AppBasic {
public:
void prepareSettings(Settings *settings);
void setup();
void draw();
cairo::SurfaceImage srfOff;
cairo::Context ctxOff;
int index, n;
float w, h;
vector last;
vector cols;
float spread;
};

void pakt21App::prepareSettings(Settings *settings) {
settings->setWindowSize(WIDTH, HEIGHT);
settings->setResizable(false);
}

void pakt21App::setup() {
srfOff= cairo::SurfaceImage(WIDTH, HEIGHT, false);
ctxOff= cairo::Context(srfOff);
ctxOff.setSourceRgb(0, 0, 0);
ctxOff.paint();
n= 150;
index= 0;
for(int i= 0; i0) {
ctxOff.setSourceRgb(cols[i].r, cols[i].g, cols[i].b);
ctxOff.circle(pos, abs((pos.x-last[i].x)+(pos.y-last[i].y))*0.5f);
ctxOff.fill();
}
last[i]= pos;
}
index++;
ctx.copySurface(srfOff, srfOff.getBounds());
}

CINDER_APP_BASIC(pakt21App, Renderer2d)