2017-06-08 3 views
0

私はチュートリアルに従うためmonogameのための新しいコードは何だが、私はこの問題に気づく:私は何をすべき、Monogame GraphicsDeviceに

GraphicsDevice.RenderState.CullMode = CullMode.None; 

     GraphicsDevice.VertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionColor.VertexElements); 

このコードはmonogameに欠けているの? これはチュートリアルの完全なコードです:

protected override void Draw(GameTime gameTime) 
    { 
     GraphicsDevice.Clear(Color.CornflowerBlue); 
     GraphicsDevice.RenderState.CullMode = CullMode.None; 

     GraphicsDevice.VertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionColor.VertexElements); 

     BasicEffect effect = new BasicEffect(GraphicsDevice, null); 
     effect.World = Matrix.Identity; 
     effect.View = camera.viewMatrix; 
     effect.Projection = camera.projectionMatrix; 

     effect.VertexColorEnabled = true; 

     effect.Begin(); 
     foreach (EffectPass pass in effect.CurrentTechnique.Passes) 
     { 
      pass.Begin(); 
      GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, verts, 0, 2); 
      pass.End(); 
     } 
     effect.End(); 

     base.Draw(gameTime); 
    } 

ありがとうございました。

答えて

関連する問題