2017-06-08 6 views
0

Ich folge ein Tutorial, aber ich bemerke dieses Problem:monogame Was ist der neue Code für monogame für Graphics

GraphicsDevice.RenderState.CullMode = CullMode.None; 

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

Dieser Code in monogame fehlt, Was soll ich tun? Dies ist der vollständige Code des Tutorials:

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); 
    } 

Danke.

Antwort