예제 #1
0
        public override void Render(GameTime time)
        {
            if (device11 == null)
            {
                return;
            }

            device11.ImmediateContext.ClearRenderTargetView(renderTargetView, new Color4(1.0f, 0, 0, 1.0f));
            device11.ImmediateContext.ClearDepthStencilView(depthView, DepthStencilClearFlags.Depth, 1.0f, 0);
            RenderComponents(time);
        }
예제 #2
0
        public override void Render(GameTime time)
        {
            base.Render(time);

            frameAccumulator += time.ElapsedMiliseconds;
            ++frameCount;
            if (frameAccumulator >= 1000000.0f)
            {
                Master.I.form.Text = "Ch0nkEngineRenderer : fps:" + (int)((frameCount / frameAccumulator) * 100000);

                frameAccumulator = 0.0f;
                frameCount = 0;
            }
        }
예제 #3
0
 public override void Update(GameTime time)
 {
     UpdateComponents(time);
 }
예제 #4
0
 private void MainForm_Load(object sender, System.EventArgs e)
 {
     gameTime = new GameTime();
     gameTime.Start();
 }
예제 #5
0
 public override void Update(GameTime time)
 {
     base.Update(time);
 }
예제 #6
0
        public override void Render(GameTime time)
        {
            var technique = _effect.GetTechniqueByIndex(0);
            var pass = technique.GetPassByIndex(0);
            _layout = new InputLayout(Master.I.device11, pass.Description.Signature, Bl0ck.inputElements);

            // Uploading to the device
            Master.I.device11.ImmediateContext.InputAssembler.InputLayout = _layout;
            Master.I.device11.ImmediateContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.PointList;
            Master.I.device11.ImmediateContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(_vertexBuffer, Bl0ck.SizeInBytes, 0));

            Matrix worldMatrix = Matrix.Identity;
            Matrix viewMatrix = Master.I.camera.ViewMatrix;
            Matrix projectionMatrix = Master.I.camera.ProjectionMatrix;

            _effect.GetVariableByName("finalMatrix").AsMatrix().SetMatrix(worldMatrix * viewMatrix * projectionMatrix);

            // Render
            _effect.GetTechniqueByIndex(0).GetPassByIndex(0).Apply(Master.I.device11.ImmediateContext);

            Master.I.device11.ImmediateContext.Draw(_numOfVertices, 0);
            Master.I.swapChain.Present(0, PresentFlags.None);
            RenderComponents(time);
        }