Mojo.DebugRenderer.RenderPoint C# (CSharp) Méthode

RenderPoint() public méthode

public RenderPoint ( DeviceContext deviceContext, System.Vector3 p, System.Vector3 color, Camera camera ) : void
deviceContext DeviceContext
p System.Vector3
color System.Vector3
camera Camera
Résultat void
        public void RenderPoint( DeviceContext deviceContext, Vector3 p, Vector3 color, Camera camera )
        {
            var databox = deviceContext.MapSubresource( mPositionVertexBuffer,
                                                        0,
                                                        POINT_NUM_VERTICES *
                                                        POSITION_NUM_COMPONENTS_PER_VERTEX *
                                                        POSITION_NUM_BYTES_PER_COMPONENT,
                                                        MapMode.WriteDiscard,
                                                        SlimDX.Direct3D11.MapFlags.None );

            databox.Data.Write( p );

            deviceContext.UnmapSubresource( mPositionVertexBuffer, 0 );

            deviceContext.InputAssembler.InputLayout = mRenderWireframeInputLayout;
            deviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.PointList;
            deviceContext.InputAssembler.SetVertexBuffers( POSITION_SLOT,
                                                           new VertexBufferBinding( mPositionVertexBuffer,
                                                                                    POSITION_NUM_COMPONENTS_PER_VERTEX *
                                                                                    POSITION_NUM_BYTES_PER_COMPONENT,
                                                                                    0 ) );

            mEffect.GetVariableByName( "gColor" ).AsVector().Set( color );
            mEffect.GetVariableByName( "gTransform" ).AsMatrix().SetMatrix( camera.GetLookAtMatrix() * camera.GetProjectionMatrix() );
            mRenderWireframePass.Apply( deviceContext );

            deviceContext.Draw( POINT_NUM_VERTICES, 0 );
        }