pakt20

#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 pakt20App : public AppBasic {
public:
void prepareSettings(Settings *settings);
void setup();
void draw();
cairo::SurfaceImage srfOff;
cairo::Context ctxOff;
int index, n;
float w, h;
float spread;
};

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

void pakt20App::setup() {
srfOff= cairo::SurfaceImage(WIDTH, HEIGHT, false);
ctxOff= cairo::Context(srfOff);
ctxOff.setSourceRgb(0, 0, 0);
ctxOff.paint();
ctxOff.setLineWidth(1);
ctxOff.setAntiAlias(0);
index= 0;
w= getWindowWidth();
h= getWindowHeight();
n= 150;
}

void pakt20App::draw() {
cairo::Context ctx(cairo::createWindowSurface());
spread= sin(index*0.002f);
for(int i= 0; i