Could someone give me the output of this XNA code, Cant seem toget it to run:
usingMicrosoft.Xna.Framework;
usingMicrosoft.Xna.Framework.Graphics;
usingMicrosoft.Xna.Framework.Input;
usingSystem.Diagnostics;
namespacehelloxna1 {
publicclassGame1:Microsoft.Xna.Framework.Game{
GraphicsDeviceManagergraphics;
SpriteBatchsbatch;
SpriteFontfont;
VertexDeclarationverts;
BasicEffecteffect;
Stopwatchtimer;
publicreadonlyVertexPositionColor[]Vertices = {
newVertexPositionColor(newVector3(-1,-1, 0), Color.Red),
newVertexPositionColor(newVector3(1, -1, 0), Color.Green),
newVertexPositionColor(newVector3(0, 1, 0), Color.Blue) };
publicGame1(){
graphics= newGraphicsDeviceManager(this);
Content.RootDirectory= “Content”; }
protectedoverridevoidInitialize(){
verts= newVertexDeclaration(GraphicsDevice,
VertexPositionColor.VertexElements);
effect= newBasicEffect(GraphicsDevice, null);
effect.VertexColorEnabled= true;
timer= Stopwatch.StartNew();
base.Initialize();}
protectedoverridevoidLoadContent(){
sbatch= newSpriteBatch(GraphicsDevice);
font= Content.Load<SpriteFont>(“Spritefont1”); }
protectedoverridevoidUpdate(GameTimegameTime){
if(GamePad.GetState(PlayerIndex.One).Buttons.Back== ButtonState.Pressed)
this.Exit();
base.Update(gameTime); }
protectedoverridevoidDraw(GameTimegameTime) {
conststringmessage= “Hello, World!n”;
GraphicsDevice.Clear(Color.CornflowerBlue);
sbatch.Begin();
sbatch.DrawString(font,message, newVector2(23, 23), Color.Black);
sbatch.End();
floattime= (float)timer.Elapsed.TotalSeconds;
effect.World= Matrix.CreateFromYawPitchRoll(time*0.7f,time*0.8f,time*0.9f);
effect.View= Matrix.CreateLookAt(
newVector3(0,0, -5), Vector3.Zero, Vector3.Up);
effect.Projection= Matrix.CreatePerspectiveFieldOfView(
1,GraphicsDevice.Viewport.AspectRatio, 1, 10);
GraphicsDevice.RenderState.CullMode= CullMode.None;
GraphicsDevice.VertexDeclaration= verts;
effect.Begin();
effect.CurrentTechnique.Passes[0].Begin();
GraphicsDevice.DrawUserPrimitives(
PrimitiveType.TriangleList,Vertices, 0, 1);
effect.CurrentTechnique.Passes[0].End();
effect.End();
base.Draw(gameTime);} } }
Answer