2012-12-01 3 views
2

렌더링하지 않지만, 출력은 완전히 엉망이되어내 XNA 애플 리케이션은 내가 XNA에서 사용자 정의 정점 데이터를 사용하여 삼각형을 렌더링하기 위해 노력하고있어 제대로

enter image description here

내 GPU (라데온 HD7610M) 지원을 DX11.

내가 잘못한 것을하고 있거나 내 GPU 드라이버입니다. 내가 XNA에 비교적 새로운 해요

public class MyGame : Microsoft.Xna.Framework.Game 
{ 
    GraphicsDeviceManager graphics; 
    VertexBuffer vertexBuffer; 
    VertexPositionColor[] vertices; 
    BasicEffect effect; 

    public MyGame() 
    { 
     graphics = new GraphicsDeviceManager(this); 
     Content.RootDirectory = "Content"; 
     TargetElapsedTime = TimeSpan.FromTicks(333333); 
     InactiveSleepTime = TimeSpan.FromSeconds(1); 
    } 
    protected override void Initialize() 
    { 
     base.Initialize(); 
    } 

    protected override void LoadContent() 
    { 
     effect = new BasicEffect(GraphicsDevice); 
     effect.VertexColorEnabled = true; 

     vertices = new VertexPositionColor[] 
     { 
      new VertexPositionColor(new Vector3(-0.8F, -0.8F, 0), Color.Black), 
      new VertexPositionColor(new Vector3(-0.8F, 0.8F, 0), Color.Black), 
      new VertexPositionColor(new Vector3(0.8F, -0.8F, 0), Color.Black), 
      //new VertexPositionColor(new Vector3(0.8F, 0.8F, 0), Color.Black), 
     }; 

     vertexBuffer = new VertexBuffer(GraphicsDevice, VertexPositionColor.VertexDeclaration, vertices.Length, BufferUsage.WriteOnly); 
     vertexBuffer.SetData<VertexPositionColor>(vertices); 
    } 

    protected override void UnloadContent() {} 

    protected override void Update(GameTime gameTime) 
    { 
     if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) 
      this.Exit(); 

     base.Update(gameTime); 
    } 

    protected override void Draw(GameTime gameTime) 
    { 
     GraphicsDevice.Clear(Color.CornflowerBlue); 
     GraphicsDevice.SetVertexBuffer(vertexBuffer); 

     foreach (EffectPass pass in effect.CurrentTechnique.Passes) 
     { 
      pass.Apply(); 
      GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, 1); 
     } 

     base.Draw(gameTime); 
    } 
} 

:

여기 내 코드입니다. 내가 뭔가 잘못하고 있는거야?

답변

1

해결되었습니다. 명시 적으로 백 버퍼의 크기를

graphics.IsFullScreen = true; 

또는 설정 :

graphics.PreferredBackBufferWidth = width; 
graphics.PreferredBackBufferWidth = height; 

이 나도 전체 화면하는 GDM을 설정했다
관련 문제