pakt10

#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 pakt10App : public AppBasic {
public:
void prepareSettings(Settings *settings);
void setup();
void draw();
int index, n;
float rows, cols;
float rowMod, colMod;
float magic;
cairo::Context ctx;
};

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

void pakt10App::setup() {
index= 0;
n= 1200;
rows= 11;
cols= 12;
rowMod= 2.0f;
colMod= 3.0f;
magic= 0.0f;
ctx= cairo::Context(cairo::createWindowSurface());
}

void pakt10App::draw() {

float w= getWindowWidth();
float h= getWindowHeight();
float r= rows+(sin(index*0.013)*rowMod)+(sin(index*0.00133)*rowMod*0.56);
float c= cols+(cos(index*0.022)*colMod)+(cos(index*0.00122)*colMod*0.45);

cairo::GradientRadial radialGrad(getWindowCenter(), 0, getWindowCenter(), getWindowWidth());
radialGrad.addColorStop(0, Color(0.2, 0.2, 0.5));
radialGrad.addColorStop(1, Color(0, 0, 0));
ctx.setSource(radialGrad);
ctx.paint();

ctx.setSourceRgba(1, 1, 0.2, 0.85);
for(int i= 0; i