protected override void LoadContent() { device = GraphicsDevice; cCross = new CoordCross(device); viewMatrix = Content.Load <Matrix>("camerasettings"); }
protected override void LoadContent() { device = graphics.GraphicsDevice; cCross = new CoordCross(device); spacecraftModel = Content.Load <Model>("Ship"); modelTransforms = new Matrix[spacecraftModel.Bones.Count]; }
protected override void LoadContent() { device = graphics.GraphicsDevice; cCross = new CoordCross(device); terrain = new Terrain(device, Content); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); InitVertices(); cCross = new CoordCross(device); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myVertexDeclaration = new VertexDeclaration(device, VertexPositionColor.VertexElements); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); road = Content.Load <Texture2D>("road"); myVertexDeclaration = new VertexDeclaration(device, VertexPositionNormalTexture.VertexElements); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); myTexture = Content.Load <Texture2D>("XNAtexture"); InitVertices(); cCross = new CoordCross(device); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myModel = XNAUtils.LoadModelWithBoundingSphere(ref modelTransforms, "Ship", Content); }
protected override void LoadContent() { device = graphics.GraphicsDevice; spriteBatch = new SpriteBatch(device); basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); terrain = new Terrain(device, Content); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myTexture = Content.Load <Texture2D>("billboardtexture"); bbEffect = Content.Load <Effect>("bbEffect"); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myTexture = Content.Load <Texture2D>("billboardtexture"); AddBillboards(); myVertexDeclaration = new VertexDeclaration(device, VertexPositionTexture.VertexElements); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myTexture = Content.Load <Texture2D>("XNAtexture"); InitVertices(); InitIndices(); vertices = GenerateNormalsForTriangleList(vertices, indices); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); spriteBatch = new SpriteBatch(device); cCross = new CoordCross(device); PresentationParameters pp = device.PresentationParameters; resolveTexture = new ResolveTexture2D(device, pp.BackBufferWidth, pp.BackBufferHeight, 1, device.DisplayMode.Format); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myModel = Content.Load <Model>("Ship"); modelTransforms = new Matrix[myModel.Bones.Count]; Effect ppEffect = Content.Load <Effect>("postprocessing"); postProcessor = new PostProcessor(device, ppEffect); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); spriteBatch = new SpriteBatch(device); PresentationParameters pp = device.PresentationParameters; int width = pp.BackBufferWidth / 2; int height = pp.BackBufferHeight / 4; renderTarget = new RenderTarget2D(device, width, height, 1, device.DisplayMode.Format); rendertargetProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, (float)width / (float)height, 0.5f, 100.0f); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myTexture = Content.Load <Texture2D>("explosion"); expEffect = Content.Load <Effect>("explosionEffect"); myVertexDeclaration = new VertexDeclaration(device, VertexExplosion.VertexElements); //only used to render one line of text! spriteBatch = new SpriteBatch(device); spriteFont = Content.Load <SpriteFont>("arial"); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); myModel = Content.Load <Model>("Ship"); modelTransforms = new Matrix[myModel.Bones.Count]; PresentationParameters pp = GraphicsDevice.PresentationParameters; targetRenderedTo = new RenderTarget2D(device, pp.BackBufferWidth, pp.BackBufferHeight, 1, device.DisplayMode.Format); resolveTexture = new ResolveTexture2D(device, pp.BackBufferWidth, pp.BackBufferHeight, 1, device.DisplayMode.Format); postProcessingEffect = Content.Load <Effect>("postprocessing"); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); PresentationParameters pp = device.PresentationParameters; int width = pp.BackBufferWidth; int height = pp.BackBufferHeight; renderTarget = new RenderTarget2D(device, width, height, 1, device.DisplayMode.Format); mirrorEffect = Content.Load <Effect>("mirrorEffect"); myModel = Content.Load <Model>("dude"); modelTransforms = new Matrix[myModel.Bones.Count]; }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); Texture2D heightMap = Content.Load <Texture2D>("heightmap"); heightData = LoadHeightData(heightMap); grassTexture = Content.Load <Texture2D>("grass"); myVertexDeclaration = new VertexDeclaration(device, VertexPositionNormalTexture.VertexElements); VertexPositionNormalTexture[] terrainVertices = CreateTerrainVertices(); int[] terrainIndices = CreateTerrainIndices(); terrainVertices = GenerateNormalsForTriangleStrip(terrainVertices, terrainIndices); CreateBuffers(terrainVertices, terrainIndices); }
protected override void LoadContent() { device = graphics.GraphicsDevice; cCross = new CoordCross(device); Texture2D grassTexture = Content.Load <Texture2D>("grass"); Texture2D heightMap = Content.Load <Texture2D>("heightmap"); int width = heightMap.Width; int height = heightMap.Height; float[,] heightData = TerrainUtils.LoadHeightData(heightMap); VertexPositionNormalTexture[] vertices = TerrainUtils.CreateTerrainVertices(heightData); int[] indices = TerrainUtils.CreateTerrainIndices(width, height); vertices = TerrainUtils.GenerateNormalsForTriangleStrip(vertices, indices); VertexPositionNormalTexture[,] vertexArray = Reshape1Dto2D <VertexPositionNormalTexture>(vertices, width, height); rootNode = new QTNode(vertexArray, device, grassTexture, 64); }
protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = new BasicEffect(device, null); cCross = new CoordCross(device); grassTexture = Content.Load <Texture2D>("grass"); Texture2D heightMap = Content.Load <Texture2D>("heightmap"); heightData = LoadHeightData(heightMap); myVertexDeclaration = new VertexDeclaration(device, VertexPositionNormalTexture.VertexElements); VertexPositionNormalTexture[] terrainVertices = CreateTerrainVertices(); int[] terrainIndices = CreateTerrainIndices(); terrainVertices = GenerateNormalsForTriangleStrip(terrainVertices, terrainIndices); terrainVertexBuffer = new VertexBuffer(device, VertexPositionNormalTexture.SizeInBytes * terrainVertices.Length, BufferUsage.WriteOnly); terrainVertexBuffer.SetData(terrainVertices); int terrainSize = 1024; Triangle leftTriangle = new Triangle(null, new Vector2(0, 0), new Vector2(terrainSize, 0), new Vector2(0, terrainSize), heightData); Triangle rightTriangle = new Triangle(null, new Vector2(terrainSize, terrainSize), new Vector2(0, terrainSize), new Vector2(terrainSize, 0), heightData); leftTriangle.AddNeighs(null, null, rightTriangle); rightTriangle.AddNeighs(null, null, leftTriangle); triangleList = new List <Triangle>(); triangleList.Add(leftTriangle); triangleList.Add(rightTriangle); indicesList = new List <int>(); foreach (Triangle t in triangleList) { t.AddIndices(ref indicesList); } dynTerrainIndexBuffer = new DynamicIndexBuffer(device, typeof(int), indicesList.Count, BufferUsage.WriteOnly); dynTerrainIndexBuffer.SetData(indicesList.ToArray(), 0, indicesList.Count, SetDataOptions.Discard); dynTerrainIndexBuffer.ContentLost += new EventHandler(dynIndexBuffer_ContentLost); orthoView = Matrix.CreateLookAt(new Vector3(terrainSize / 2, 100, -terrainSize / 2), new Vector3(terrainSize / 2, 0, -terrainSize / 2), Vector3.Forward); orthoProj = Matrix.CreateOrthographic(terrainSize, terrainSize, 1, 1000); }
protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Load our fonts into the static Font class Fonts.LoadContent(Content); device = graphics.GraphicsDevice; cCross = new CoordCross(device); weapon = Content.Load<Model>("weapon"); crosshair = Content.Load<Texture2D>("crosshair1"); // Initialize the weapon matrices. weaponTransforms = new Matrix[weapon.Bones.Count]; weaponWorldMatrix = Matrix.Identity; terrain = new Terrain(device, Content); dino = Content.Load<Model>("dino"); spherePrimitive = new SpherePrimitive(GraphicsDevice, 0.5f, 12); }