pakt09

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

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

void pakt09App::setup() {
index= 0;
n= 1000;
m= 0;
rows= 3;
cols= 4;
magic= 50;

ctx= cairo::Context(cairo::createWindowSurface());
}

void pakt09App::draw() {

float w= getWindowWidth();
float h= getWindowHeight();

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

ctx.setSourceRgba(1, 1, 1, 0.85);
if(m