Skip to content

Instantly share code, notes, and snippets.

@tanelsuurhans
Created January 26, 2012 18:55
Show Gist options
  • Save tanelsuurhans/1684361 to your computer and use it in GitHub Desktop.
Save tanelsuurhans/1684361 to your computer and use it in GitHub Desktop.
protected override void Draw(GameTime gameTime) {
this.GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.PowderBlue, 1.0f, 0);
effect.CurrentTechnique = effect.Techniques["Simple"];
effect.Parameters["World"].SetValue(Matrix.CreateTranslation(new Vector3(0, 0, -20)));
effect.Parameters["View"].SetValue(this.camera.View);
effect.Parameters["Projection"].SetValue(this.camera.Projection);
effect.Parameters["TextureFile"].SetValue(this.texture);
foreach (EffectPass pass in effect.CurrentTechnique.Passes) {
pass.Apply();
this.GraphicsDevice.DrawUserPrimitives<VertexPositionTexture>(PrimitiveType.TriangleList, chunk.Vertices, 0, chunk.PrimitiveCount);
}
base.Draw(gameTime);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment