Exemplo n.º 1
0
 void SDFTestbench_UpdateFrame(object sender, FrameEventArgs e)
 {
     var d = new FrameData
     {
         Time = e.Time
     };
     Components.Update(d);
 }
Exemplo n.º 2
0
        void SDFTestbench_RenderFrame(object sender, FrameEventArgs e)
        {
            iterations++;
            FrameData frame = new FrameData() { Time = e.Time, Elapsed = stopwatch.Elapsed };
            sdfRenderer.Wheel = this.wheel;

            if ((iterations & 0x3f) == 0)
            {
                shaderWatcher.Poll();
                if (shaderWatcher.HasChanges)
                {
                    this.Components.Reload();
                    shaderWatcher.Reset();
                }
            }

            GL.Viewport(this.ClientRectangle);
            //GL.ClearColor(0.0f, 0.0f, 0.3f, 1.0f);
            GL.ClearDepth(1.0);
            GL.Clear(ClearBufferMask.DepthBufferBit);
            //GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            textManager.AddOrUpdate(frameCounter.TextBlock);

            float y = 0.1f;
            //textManager.AddOrUpdate(new TextBlock("camera", string.Format("{0}", camera.EyePos.ToString()), new Vector3(0.0f, y, 0.0f), 0.0005f, Color4.Wheat.ToVector4())); y += 0.05f;

            Components.Render(frame);

            SwapBuffers();
            Thread.Sleep(0);
        }