pakt04

#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 pakt04App : public AppBasic {
public:
void prepareSettings(Settings *settings);
void setup();
void draw();
int index, n;
};

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

void pakt04App::setup() {
index= 0;
n= 90;
}

void pakt04App::draw() {

float x= getWindowCenter().x;
float y= getWindowCenter().y;
float w= getWindowWidth()*0.49;
float h= getWindowHeight()*0.49;
float spreadx= sin(index*0.005)*5.0;
float spready= cos(index*0.006)*5.0;
float wx= w*(sin(index*0.0125)*0.4+0.6);
float hy= h*(cos(index*0.01)*0.4+0.6);

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

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

ctx.setSourceRgba(1, 1, 1, 0.8);
ctx.setLineWidth(3.0);
for(int i= 0; i