pakt24

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

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

void pakt24App::setup() {
srfOff= cairo::SurfaceImage(WIDTH, HEIGHT, false);
ctxOff= cairo::Context(srfOff);
ctxOff.setLineWidth(0.1);
index= 0;
w= getWindowWidth();
h= getWindowHeight();
n= 80;
}

void pakt24App::draw() {

float rx= sin(index*0.0012f);
float ry= sin(index*0.0022f+1.0f);
float tx= sin(index*0.0032f+2.0f)+rx;
float ty= sin(index*0.0042f+3.0f)+ry;

cairo::Context ctx(cairo::createWindowSurface());
ctxOff.setSourceRgba(1, 1, 1, 0.02);
ctxOff.paint();

ctxOff.setSourceRgba(0, 0, 0, 1);
for(int i= 0; i