<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Blog of Zachary Snow &#187; Code Snippets</title>
	<atom:link href="http://zacharysnow.net/tag/code-snippets/feed/" rel="self" type="application/rss+xml" />
	<link>http://zacharysnow.net</link>
	<description></description>
	<lastBuildDate>Tue, 20 Dec 2011 19:41:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Drawing Rectangles with SpriteBatch</title>
		<link>http://zacharysnow.net/2010/03/29/drawing-rectangles-with-spritebatch/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=drawing-rectangles-with-spritebatch</link>
		<comments>http://zacharysnow.net/2010/03/29/drawing-rectangles-with-spritebatch/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 17:14:25 +0000</pubDate>
		<dc:creator>Zachary</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://zacharysnow.net/2010/03/29/drawing-rectangles-with-spritebatch/</guid>
		<description><![CDATA[Just a quick code snippet which adds an extension method for drawing Rectangles to SpriteBatch: public static class SpriteBatchHelper { static Texture2D pixel; private static void LoadPixel(GraphicsDevice graphicsDevice) { if(pixel == null) { pixel = new Texture2D(graphicsDevice, 1, 1); pixel.SetData&#60;Color&#62;(new &#8230; <a href="http://zacharysnow.net/2010/03/29/drawing-rectangles-with-spritebatch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick code snippet which adds an extension method for drawing Rectangles to SpriteBatch:</p>
<pre name="code" class="c#">
public static class SpriteBatchHelper
{
	static Texture2D pixel;

	private static void LoadPixel(GraphicsDevice graphicsDevice)
	{
		if(pixel == null)
		{
			pixel = new Texture2D(graphicsDevice, 1, 1);
			pixel.SetData&lt;Color&gt;(new Color[] { Color.White });
		}
	}

	public static void DrawRectangle(this SpriteBatch spriteBatch, Rectangle rectangle, Color color)
	{
		LoadPixel(spriteBatch.GraphicsDevice);
		spriteBatch.Draw(pixel, rectangle, color);
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://zacharysnow.net/2010/03/29/drawing-rectangles-with-spritebatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

