Esempio n. 1
0
 public override void Process(Camera cam, Texture output, IAccelerator acc)
 {
     uint[] pix = output.Pixel;
     for(int i = 0; i < pix.Length; i++) {
         pix[i] = ColorUtils.AlphaChannel|ColorUtils.Random(pix[i], delta);
     }
 }
Esempio n. 2
0
        private void glControl1_Load(object sender, EventArgs e)
        {
            timer.Start();
            LastTime = timer.ElapsedMilliseconds;

            display = new Display(glControl1);
            camera = new Camera(display);
        }
Esempio n. 3
0
 public RenderWindow(Camera cam)
 {
     this.cam = cam;
     this.ClientSize = new Size(cam.Width, cam.Height);
     Thread t = new Thread(KeepCameraBusy);
     t.IsBackground = true;
     t.Start();
     Thread t2 = new Thread(UpdateForm);
     t2.IsBackground = true;
     t2.Start();
     this.SetStyle(ControlStyles.DoubleBuffer, true);
 }
Esempio n. 4
0
 public override void Process(Camera cam, Texture output, Accelerator acc)
 {
     int px = 250;
     int py = 250;
     int cx = 500;
     int cy = 500;
     float dx = (float)(cx-px);
     float dy = (float)(cy-py);
     int posx, posy, xsize, ysize;
     float zoom;
     for(int i = 0; i < flares; i++) {
         zoom = Maths.Pythagoras(dx, dy)/Maths.Pythagoras(cx, cy);
         zoom = 1.5f-0.5f*zoom;
         xsize = flare[i].Width;
         ysize = flare[i].Height;
         posx = px+(int)(dx*flareDist[i]);
         posy = py+(int)(dy*flareDist[i]);
         cam.Raster.AddWithAlpha(flare[i], posx-xsize/2, posy-ysize/2, xsize, ysize);
     }
 }
Esempio n. 5
0
 public abstract void Process(Camera cam, Texture output, IAccelerator acc);