pakt02

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

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

void pakt02App::setup() {
index= 0;
n= 50;
}

void pakt02App::draw() {

float x= 10+(sin(index*0.016)*2);
float y= getWindowCenter().y+(sin(index*0.010)*50);
float x3= getWindowWidth()-10+(sin(index*0.012)*2);
float y3= getWindowCenter().y+(sin(index*0.014)*50);
float w= getWindowWidth()*0.5;
float h= getWindowHeight()*0.5;
float spread= lmap(sin(index*0.0005), -1.0, 1.0, 0.5, 1.5);

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

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

double dashes[]= {sin(index*0.0023)*50.0+51, cos(index*0.0023)*50.0+51};
ctx.setDash(dashes, 2, 0);
// ctx.setLineCap(cairo::LINE_CAP_ROUND);
ctx.setSourceRgba(1, 1, 0, 0.8);
ctx.setLineWidth(1.0);

for(int i= 0; i