pakt25

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

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

void pakt25App::setup() {
srfOff= cairo::SurfaceImage(WIDTH, HEIGHT, false);
ctxOff= cairo::Context(srfOff);
ctxOff.setLineWidth(0.5);
index= 0;
w= getWindowWidth();
h= getWindowHeight();
}

void pakt25App::draw() {

n= sin(index*0.0006f)*15+20;

cairo::Context ctx(cairo::createWindowSurface());
ctxOff.setSourceRgba(0, 0, 0, 0.02);
ctxOff.paint();

ctxOff.setSourceRgba(1, 1, 1, 1);
ctxOff.moveTo(0, h*0.5);
for(int i= 0; i