pakt22

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

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

void pakt22App::setup() {
srfOff= cairo::SurfaceImage(WIDTH, HEIGHT, false);
ctxOff= cairo::Context(srfOff);
ctxOff.setSourceRgb(0, 0, 0);
ctxOff.paint();
index= 0;
w= getWindowWidth();
h= getWindowHeight();
cols= 10;
rows= 14;
}

void pakt22App::draw() {

cairo::Context ctx(cairo::createWindowSurface());
ctxOff.setSourceRgba(0.1, 0, 0, 0.1);
ctxOff.paint();
ctxOff.setFillRule(1);
ctxOff.setSourceRgb(1.0, 0.0, 0.0);
theta= (sin(index*0.0004f)*0.1f)+(sin(index*0.004f)*(sin(index*0.00004f)*6.0f));
float rc= (sin(index*0.051f)*0.01f+1.0f)/cols;
float rr= (cos(index*0.062f)*0.01f+1.0f)/rows;

for(int x= 0; x