Ejemplo n.º 1
0
        private void ParticleTestBench_RenderFrame(object sender, FrameEventArgs e)
        {
            if (shaderUpdatePoller.HasChanges)
            {
                components.Reload();
                shaderUpdatePoller.Reset();
            }

            components.ProjectionMatrix = camera.Projection;
            components.ViewMatrix       = camera.View;


            GL.ClearColor(0.0f, 0.1f, 0.2f, 1.0f);
            GL.ClearDepth(1.0);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);


            components.Render(frameData);



            GL.Disable(EnableCap.DepthTest);
            GL.Enable(EnableCap.Blend);

            //text.Render();

            SwapBuffers();
            model.SwapBuffers();
            Thread.Sleep(0);
        }
Ejemplo n.º 2
0
        private void TestBench_RenderFrame(FrameEventArgs e)
        {
            if (shaderUpdatePoller.Poll())
            {
                components.Reload();
                shaderUpdatePoller.Reset();
            }

            GL.ClearColor(0.0f, 0.1f, 0.2f, 1.0f);
            GL.ClearDepth(1.0);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            //GL.Disable(EnableCap.DepthTest);
            //GL.Enable(EnableCap.Blend);


            components.Render(frameData);

            SwapBuffers();
            Thread.Sleep(0);
        }
Ejemplo n.º 3
0
        public override void Render(IFrameRenderData renderData, IFrameBufferTarget target)
        {
            frameData = renderData as FrameData;
            base.Render(renderData, target);  // We render our component (line graphs), then we render the text over the top (below).

            textManager.ModelMatrix      = Matrix4.CreateScale(2f, ModelMatrix.Row1.Y, 1f);
            textManager.ViewMatrix       = ViewMatrix;
            textManager.ProjectionMatrix = ProjectionMatrix;
            textManager.Refresh();

            //components.Do<ITransformable>(c => { c.ViewMatrix = ViewMatrix; c.ProjectionMatrix = ProjectionMatrix; }); // TODO: temp hack until operatorcomponentbase is derived from compositecomponent

            // TODO: this needs to be simplified. See note above about OperatorComponentBase / CompositeComponent etc
            if (target != null)
            {
                components.RenderToTarget(renderData, target);
            }
            else
            {
                components.Render(renderData);
            }
        }
Ejemplo n.º 4
0
        private void VisHost_RenderFrame(FrameEventArgs e)
        {
            //lock (this.threadLock)
            //{
            double time = timer.Elapsed.TotalSeconds;

            frameData.DeltaRenderTime = time - frameData.RenderTime;
            frameData.RenderTime      = time;

            if (shaderUpdatePoller.HasChanges)
            {
                components.Reload();
                shaderUpdatePoller.Reset();
            }

            //text.AddOrUpdate(title);

            GL.ClearColor(0.0f, 0.0f, 0.0f, 1.0f);
            GL.ClearDepth(1.0);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);


            components.Render(frameData);



            //GL.Disable(EnableCap.DepthTest);
            //GL.Enable(EnableCap.Blend);

            //text.Render();

            //GL.Finish();

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