Recent Posts
JavaScript | 3 sec ago
Java | 39 sec ago
None | 43 sec ago
None | 1 min ago
PHP | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Python | 2 min ago
PHP | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 10th of Feb 2010 12:47:09 AM Download | Raw | Embed | Report
  1.             if (_contentHandler.Effects.ContainsKey("GravityShader"))
  2.             {
  3.                 _spriteBatch.Begin(SpriteBlendMode.Additive, SpriteSortMode.Immediate, SaveStateMode.None);
  4.  
  5.                 Matrix matrix = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 0, 1);
  6.                 _contentHandler.Effects["GravityShader"].Parameters["World"].SetValue(matrix);
  7.                 _contentHandler.Effects["GravityShader"].Parameters["View"].SetValue(matrix);
  8.                 _contentHandler.Effects["GravityShader"].Parameters["Projection"].SetValue(matrix);
  9.                 _contentHandler.Effects["GravityShader"].Begin();
  10.                 _contentHandler.Effects["GravityShader"].CurrentTechnique.Passes[0].Begin();
  11.  
  12.                 for (int i = 0; i < _particleManager.Particles.Count; i++)
  13.                 {
  14.                     if (_particleManager.Particles[i].Texture != null)
  15.                         _spriteBatch.Draw(
  16.                             _particleManager.Particles[i].Texture,
  17.                             _particleManager.Particles[i].Position,
  18.                             _particleManager.Particles[i].SourceRectangle,
  19.                             _particleManager.Particles[i].Color,
  20.                             _particleManager.Particles[i].Rotation,
  21.                             _particleManager.Particles[i].Origin,
  22.                             _particleManager.Particles[i].Scale,
  23.                             SpriteEffects.None,
  24.                             _particleManager.Particles[i].LayerDepth
  25.                             );
  26.                 }
  27.  
  28.                 _spriteBatch.End();
  29.  
  30.                 _contentHandler.Effects["GravityShader"].CurrentTechnique.Passes[0].End();
  31.                 _contentHandler.Effects["GravityShader"].End();
  32.             }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: