<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Jesse Silver&#039;s Blog &#187; Open Source</title>
	<atom:link href="http://jsilver999.wordpress.com/category/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://jsilver999.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sun, 13 May 2012 03:46:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jsilver999.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Jesse Silver&#039;s Blog &#187; Open Source</title>
		<link>http://jsilver999.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jsilver999.wordpress.com/osd.xml" title="Jesse Silver&#039;s Blog" />
	<atom:link rel='hub' href='http://jsilver999.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Proper Colour Picking in CubicVR</title>
		<link>http://jsilver999.wordpress.com/2012/05/12/proper-colour-picking-in-cubicvr/</link>
		<comments>http://jsilver999.wordpress.com/2012/05/12/proper-colour-picking-in-cubicvr/#comments</comments>
		<pubDate>Sat, 12 May 2012 22:12:26 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=91</guid>
		<description><![CDATA[So I needed to be able to accurately pick at things in a 3D scene in CubicVR, but a bounding box ray test (scene.bbRayTest()) wasn&#8217;t providing that. If a mesh had an odd shape, or holes, it wouldn&#8217;t be very accurate, since everything was picked based on a bounding box. So I looked up online [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=91&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I needed to be able to accurately pick at things in a 3D scene in CubicVR, but a bounding box ray test (scene.bbRayTest()) wasn&#8217;t providing that. If a mesh had an odd shape, or holes, it wouldn&#8217;t be very accurate, since everything was picked based on a bounding box. So I looked up online how other people were doing it. The general answer was called colour picking. The general process for this would be:</p>
<p>1. Render each pickable object to a backbuffer with a slightly different colour.</p>
<p>2. Get the colour at the pixel your mouse is at.</p>
<p>3. See if it matches up with anything in the scene that is pickable. If so, you have a match.</p>
<p>It seems simple enough, but there&#8217;s a lot of little things that needed to be taken care of before it would actually work.</p>
<p>- It needed to be flat shaded, no lights at all.</p>
<p>- Nothing should affect the color (such as texture, wireframe mode, ambient, specular, etc..). So the material has to be completely different, and wireframe mode on the scene object needs to be set off.</p>
<p>- <a href="http://asalga.wordpress.com/2011/08/01/using-webgl-readpixels-turn-on-preservedrawingbuffer/">gl.readPixels() does not work on Google Chrome without setting preserveDrawingBuffer to true when getting the WebGL context</a></p>
<p>- CubicVR stores colors as floats between 0 and 1, gl.readPixels() gives you bytes. You need to take that into account.</p>
<p>- The mouse position y you send to gl.readPixels() has to be flipped, so you use height &#8211; mouseY instead.</p>
<p>To test this, I took the CubicVR picking demo that already existed, and tried to use my colour picking code instead of scene.bbRayTest(). Click <a href="http://matrix.senecac.on.ca/~jasilver1/CubicVR/picking/colorPicking.html">here </a>to view this test, and <a href="http://matrix.senecac.on.ca/~jasilver1/CubicVR/picking/rayPicking.html">here</a> to view the original test. It&#8217;s amazing how something simple can have a lot of edge cases you need to take care of before anything will work.</p>
<p>Edit: It seems that in the example, I actually had a couple of issues that I still didn&#8217;t catch. Mainly that I was doing the picking code in the main loop, creating the backbuffer every check, and creating a new material for each object every check. Firefox didn&#8217;t like this if left alone. So, I cached both the unique material, and the drawing buffer. Then I only called the picking code on movemove, an recreated the buffer during window resize. That should solve the earlier issues I had.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=91&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2012/05/12/proper-colour-picking-in-cubicvr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>
	</item>
		<item>
		<title>Mouse Lock Tests and Demos</title>
		<link>http://jsilver999.wordpress.com/2011/12/01/mouse-lock-tests-and-demos/</link>
		<comments>http://jsilver999.wordpress.com/2011/12/01/mouse-lock-tests-and-demos/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 10:01:14 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=87</guid>
		<description><![CDATA[Thankfully now we&#8217;re at the point where we have most of the Mouse Lock feature set from the specifications implemented, so that&#8217;s most of the work done already. Now we have to make sure that everything stays working, and that all edge cases and bugs are properly dealt with. Last Sunday, I converted the CubicVR [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=87&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thankfully now we&#8217;re at the point where we have most of the Mouse Lock feature set from the specifications implemented, so that&#8217;s most of the work done already. Now we have to make sure that everything stays working, and that all edge cases and bugs are properly dealt with.</p>
<p>Last Sunday, I converted the CubicVR FPS Demo to use Mouse Lock. <a href="http://humphd.github.com/mozilla-central/mouselock/index.html">All of our current demos are up over here</a>, if you have one of our current builds with mouse lock in it. It showed it off pretty well how Mouse Lock in the browser can work for a game.</p>
<p>Now I also have to write a few tests, mainly to see if pointer.lock() and pointer.unlock() are working as they should under different conditions, and that the success and failure callbacks from pointer.lock() are firing at the right times. So I looked at the current mouselock mochitest example, which had some of this already done (mouselock/test_fullscreen.html). The first thing I saw was that it was trying to work off a setTimeout for mozRequestFullScreen(), instead of doing it on load, so I changed that. I ended up doing most of my logic inside the &#8220;mozfullscreenchange&#8221; event, since it&#8217;s pretty easy to check for different things relating to mouse lock in there. So I&#8217;m doing different tests, and find out randomly that pointer.lock(null) will actually break the browser in the current build. So I look at the stack trace the test gave me, and luckily it showed the exact line number/file it happened in.</p>
<p>nsCOMPtr&lt;nsIDOMNode&gt; targetNode(do_QueryInterface(aTarget));<br />
nsCOMPtr&lt;nsIDOMNode&gt; parentNode;<br />
targetNode-&gt;GetParentNode(getter_AddRefs(parentNode)); // This is going to crash if targetNode is NULL.</p>
<p>Therefore, before targetNode is deferenced, I had to check for targetNode being NULL, just a simple</p>
<p>if (!targetNode) return false;</p>
<p>I rebuilt and tested for the same thing, and now it doesn&#8217;t crash.</p>
<p>Hooray for testing!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=87&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/12/01/mouse-lock-tests-and-demos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>
	</item>
		<item>
		<title>A Different Approach</title>
		<link>http://jsilver999.wordpress.com/2011/11/24/a-different-approach/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/24/a-different-approach/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 05:15:50 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=85</guid>
		<description><![CDATA[So yesterday I had a working windows version of mouse lock. The problem was that it required you to go a long way just to get both of the things you needed for the widget to know mouse lock was on, and it was OS specific. But the new solution says that nsIWidget doesn&#8217;t need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=85&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So yesterday I had a working windows version of mouse lock. The problem was that it required you to go a long way just to get both of the things you needed for the widget to know mouse lock was on, and it was OS specific. But the new solution says that nsIWidget doesn&#8217;t need to know.</p>
<p>nsEventStateManager will store if mouse lock is on. And the MouseLockable on lock() and unlock() will set that boolean value. When the mouse is moved and mouse lock is on, the nsEventStateManager will call aEvent-&gt;widget-&gt;SynthesizeNativeMouseEvent() with the coordinates of center of the screen, and the appropriate native message based on the OS. nsIWidget&#8217;s SynthesizeNativeMouseEvent() calls SetCursorPos() on windows just like I was doing, and the correct version for each OS. So it looks like everything is still working, but with a lot less code, and a lot more code that works on all supported operating systems.</p>
<p>The only problem is that not all operating systems have nsIWidget&#8217;s SynthesizeNativeMouseEvent() function implemented, so we&#8217;re going to have to do some research for the ones that don&#8217;t (for example, the GTK2 Linux one was oddly absent), and implement it ourselves.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=85&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/24/a-different-approach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Mouse Lock and Wiring Up nsIWidget</title>
		<link>http://jsilver999.wordpress.com/2011/11/23/windows-mouse-lock-and-wiring-up-nsiwidget/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/23/windows-mouse-lock-and-wiring-up-nsiwidget/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 05:11:42 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=80</guid>
		<description><![CDATA[So, with Humph showing me nsEventStateManager, a lightbulb went off in my head. nsEventStateManager::GenerateMouseEnterExit(aEvent) takes an nsGUIEvent* as its parameter. nsGUIEvent has a widget attached to it. We can get the widget now. Then I found out about nsFocusManager::GetFocusManager()-&#62;GetFocusedWindow(ptr), which gives you the nsIDOMWindow currently in focus. Great! Now I can keep going down the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=80&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, with Humph showing me nsEventStateManager, a lightbulb went off in my head. nsEventStateManager::GenerateMouseEnterExit(aEvent) takes an nsGUIEvent* as its parameter. nsGUIEvent has a widget attached to it. We can get the widget now. Then I found out about nsFocusManager::GetFocusManager()-&gt;GetFocusedWindow(ptr), which gives you the nsIDOMWindow currently in focus. Great! Now I can keep going down the tree until I find my MouseLockable instance. Then, all I need to do to tell the widget that mouse lock is now on is to set a boolean in it. Now that the nsIWidget (nsWindow is one), knows that its mouse lock is on or off, it can do OS-Specific code for it, as described a few posts back.</p>
<p>(In GenerateMouseEnterExit(aEvent)) <a href="http://pastebin.com/pt0u2vdr">http://pastebin.com/pt0u2vdr</a></p>
<p>I also ran into a little bug with the DOM&#8217;s movement deltas when centering the mouse cursor every mouse move while in mouse lock. (it kept reporting opposite values). The solution was actually simple. Just report the last mouse position value as width/2, height/2, just like what I set the cursor too. If it&#8217;s anything but that, it must have moved from the center.</p>
<p>No clue if anything is in the right place of course. But it feels great to have some stuff actually working.</p>
<p>Time to test this with some games!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=80&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/23/windows-mouse-lock-and-wiring-up-nsiwidget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>
	</item>
		<item>
		<title>Movement Deltas on the Firefox DOM</title>
		<link>http://jsilver999.wordpress.com/2011/11/21/movement-deltas-on-the-firefox-dom/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/21/movement-deltas-on-the-firefox-dom/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 12:52:15 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=76</guid>
		<description><![CDATA[What I did was added a non-scriptable method to an nsIDOMWindow that saves the X/Y so that the next mouse event could get it, as well as attributes for the previous x/y. (in nsIDOMWindow.idl) [noscript] void saveScreenPosition(in long x, in long y); readonly attribute long lastScreenX; readonly attribute long lastScreenY; Then, in nsGlobalWindow, that function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=76&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://jsilver999.files.wordpress.com/2011/11/movementxy.png"><img class="alignnone size-full wp-image-77" title="movementxy" src="http://jsilver999.files.wordpress.com/2011/11/movementxy.png?w=497&h=243" alt="" width="497" height="243" /></a></p>
<p>What I did was added a non-scriptable method to an nsIDOMWindow that saves the X/Y so that the next mouse event could get it, as well as attributes for the previous x/y.</p>
<p><em>(in nsIDOMWindow.idl)</em><br />
[noscript] void saveScreenPosition(in long x, in long y);<br />
readonly attribute long lastScreenX;<br />
readonly attribute long lastScreenY;</p>
<p>Then, in nsGlobalWindow, that function simply sets the two members. When an nsDOMMouseEvent is created, it stores the movement deltas based on the previous/current values, then tells the nsGlobalWindow to save the current one.</p>
<p><em>(In nsDOMMouseEvent&#8217;s constructor, mView is the nsIDOMWindow)</em><br />
if (mView) {<br />
PRInt32 screenPosX, screenPosY, lastScreenPosX, lastScreenPosY;<br />
GetScreenX(&amp;screenPosX);<br />
GetScreenY(&amp;screenPosY);<br />
mView-&gt;GetLastScreenX(&amp;lastScreenPosX);<br />
mView-&gt;GetLastScreenY(&amp;lastScreenPosY);<br />
mMovement.x = screenPosX &#8211; lastScreenPosX;<br />
mMovement.y = screenPosY &#8211; lastScreenPosY;<br />
mView-&gt;SaveScreenPosition(screenPosX, screenPosY);<br />
}</p>
<p>And that was pretty much it, success.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=76&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/21/movement-deltas-on-the-firefox-dom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>

		<media:content url="http://jsilver999.files.wordpress.com/2011/11/movementxy.png" medium="image">
			<media:title type="html">movementxy</media:title>
		</media:content>
	</item>
		<item>
		<title>Mouse Lock DOM Confusion</title>
		<link>http://jsilver999.wordpress.com/2011/11/17/mouse-lock-dom-confusion/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/17/mouse-lock-dom-confusion/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 05:14:33 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=69</guid>
		<description><![CDATA[I&#8217;ve been looking through the Firefox source in an attempt to find out how to make some of these components talk to each other, but I keep on running into some sort of issue preventing me from doing so. A couple days back, I pulled Humph&#8217;s latest revision which had the MouseLockable interface, and had [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=69&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking through the Firefox source in an attempt to find out how to make some of these components talk to each other, but I keep on running into some sort of issue preventing me from doing so. A couple days back, I pulled Humph&#8217;s latest revision which had the MouseLockable interface, and had that put onto window.navigator.pointer. I&#8217;m trying to figure out a way for the OS-Specific code in nsWindow to know about the MouseLockable reference in Navigator, or for the MouseLockable to be able to tell the nsWindow to start/stop doing mouse lock. Once that is possible, my previous solution should be able to work properly, hopefully. The specification also states that the MouseLockable should only be able to have Mouse Lock turned on while FullScreen is enabled, it shouldn&#8217;t be that hard if it has a pointer to an nsIDOMWindow (like nsGeoLocation), which stores that information.</p>
<p>As well, I followed another post which describes how to add <a href="http://diogogmt.wordpress.com/2011/11/16/implementing-mouse-lock-p1-extending-mouseevent/">movement into the MouseEvent interface</a>. That&#8217;s all well and good until you find out that no where actually stores Mouse X/Y. It simply wasn&#8217;t built for it. Calling GetScreenPoint() in the event goes to the OS native code via the widget and gets the position directly and puts it inside refPoint. That&#8217;s all well and good, but events are created and destroyed in the blink of an eye, you can&#8217;t store previous mouse coordinate values there. So, seeing as the event stores an nsIBaseWidget, and nsWindow is one, it seems like previous/current mouse coordinate values should be stored there. That&#8217;s fine until I remembered that pointer is to an nsIBaseWidget, and I don&#8217;t know how to detect the type to cast it up safely to get those values. So I&#8217;m at a bit of a dead end here, hopefully tomorrow&#8217;s class can clear some things up.</p>
<p>Since the code base is so large it&#8217;s very easy to get lost, and I still feel pretty lost in all of this myself. Within the next few weeks I hope a lot of things can be cleared up. I think a lot of us feel this way right now.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=69&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/17/mouse-lock-dom-confusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>
	</item>
		<item>
		<title>Mouse Lock in Windows!</title>
		<link>http://jsilver999.wordpress.com/2011/11/11/mouse-lock-in-windows/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/11/mouse-lock-in-windows/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 07:33:19 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=60</guid>
		<description><![CDATA[After a good amount of researching through the Firefox source, especially with the Cross Reference website I&#8217;ve found out how to get mouse lock sort-of working on Windows. The key to this was the ClipCursor function in windows.h. This takes a rectangle which says where the mouse cursor can move around in. By setting this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=60&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After a good amount of researching through the Firefox source, especially with the <a href="http://mxr.mozilla.org/mozilla-central/">Cross Reference</a> website I&#8217;ve found out how to get mouse lock sort-of working on Windows. The key to this was the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms648383%28v=vs.85%29.aspx">ClipCursor function in windows.h</a>. This takes a rectangle which says where the mouse cursor can move around in. By setting this to the windows width/2, height/2, for the left/top, and the right/bottom, you&#8217;ll have a rectangle with no width and height in the middle of the screen, with a cursor that cannot move.</p>
<p>Here&#8217;s my little snippet that does just that:</p>
<p><a href="http://pastebin.com/gNmh1uhz">http://pastebin.com/gNmh1uhz</a></p>
<p>The only problem was, this doesn&#8217;t track mouse deltas, it doesn&#8217;t seem to allow for it. So I looked up the Win32 API some more on how to set the mouse position directly. I found SetMouseCursor(x,y), perfect. So my new logic was, if the mouse is not in the center, it must have moved. If it has moved, track the movement change then force it back into the center. It seems to have worked, but I still have to test it a bit more.</p>
<p>So I ended up with this (requires adding the mMousePos and mMouseLock member variables):</p>
<p><a href="http://pastebin.com/3YBfXxM2">http://pastebin.com/3YBfXxM2</a></p>
<p><a href="http://jsilver999.files.wordpress.com/2011/11/mouseinfo.png"><img class="alignnone size-medium wp-image-65" title="mouseinfo" src="http://jsilver999.files.wordpress.com/2011/11/mouseinfo.png?w=300&h=190" alt="" width="300" height="190" /></a></p>
<p>I have no clue if this is right, but I&#8217;m guessing it&#8217;s a step in the right direction in terms of what to do on Windows. Next time I&#8217;ll have to research more about getting the mouse lock/unlock functions visible on the DOM.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=60&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/11/mouse-lock-in-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>

		<media:content url="http://jsilver999.files.wordpress.com/2011/11/mouseinfo.png?w=300" medium="image">
			<media:title type="html">mouseinfo</media:title>
		</media:content>
	</item>
		<item>
		<title>The First Firefox Change</title>
		<link>http://jsilver999.wordpress.com/2011/11/10/the-first-firefox-change/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/10/the-first-firefox-change/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 18:03:51 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=57</guid>
		<description><![CDATA[While in class, Humph showed us how to get some output going by changing parts of the firefox source. I simply copied where he put the test printf, tried to build it, and saw the results. Oddly enough, my top-level build ended up taking me 20 minutes to complete. But when I ran firefox, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=57&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While in class, Humph showed us how to get some output going by changing parts of the firefox source. I simply copied where he put the test printf, tried to build it, and saw the results. Oddly enough, my top-level build ended up taking me 20 minutes to complete. But when I ran firefox, the printf showed up fine, several times. Next up, to try to fiddle around with the way the mouse works in firefox, and to keep seeing what I can change in different parts of the code.</p>
<p><a href="http://jsilver999.files.wordpress.com/2011/11/firefox-printf.png"><img class="alignnone size-medium wp-image-58" title="firefox-printf" src="http://jsilver999.files.wordpress.com/2011/11/firefox-printf.png?w=300&h=159" alt="" width="300" height="159" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=57&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/10/the-first-firefox-change/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>

		<media:content url="http://jsilver999.files.wordpress.com/2011/11/firefox-printf.png?w=300" medium="image">
			<media:title type="html">firefox-printf</media:title>
		</media:content>
	</item>
		<item>
		<title>The Frustrations of Building Firefox</title>
		<link>http://jsilver999.wordpress.com/2011/11/09/the-frustrations-of-building-firefox/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/09/the-frustrations-of-building-firefox/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 23:38:05 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=51</guid>
		<description><![CDATA[This is where making sure everything is configured correctly before the four hour wait comes in handy. Unfortunately, I must have been an impatient person, because I managed to pretty much run into every single problem on this page plus other random ones (like cannot lstat conftest.exe, or bad file number). One at a time. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=51&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is where making sure everything is configured correctly before the four hour wait comes in handy. Unfortunately, I must have been an impatient person, because I managed to pretty much run into every single problem on <a href="http://zenit.senecac.on.ca/wiki/index.php/Mouse_Lock_Implementation_FAQ">this page</a> plus other random ones (like <a href="http://andre-selmanagic.com/blog/45-one-day-spent-on-compiling-spidermonkey-cannot-lstat-conftestexe-permission-denied-">cannot lstat conftest.exe</a>, or <a href="http://stackoverflow.com/questions/1352371/nsinstall-bad-file-number-error-on-vista">bad file number</a>). One at a time. Every four hours. I&#8217;m sure many of these errors are because of windows being finicky, but I guess I can&#8217;t do all that much about that. I even forgot to put in the .mozconfig file last time, meaning I had to restart since it wasn&#8217;t building for debug mode. What a harsh lesson this has been about patience. Hopefully by the end of the night I&#8217;ll have this actually built, fingers crossed.</p>
<p>And this time I was finally successful!</p>
<p><a href="http://jsilver999.files.wordpress.com/2011/11/firefox-build.png"><img class="alignnone size-medium wp-image-55" title="firefox-build" src="http://jsilver999.files.wordpress.com/2011/11/firefox-build.png?w=300&h=179" alt="" width="300" height="179" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=51&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/09/the-frustrations-of-building-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>

		<media:content url="http://jsilver999.files.wordpress.com/2011/11/firefox-build.png?w=300" medium="image">
			<media:title type="html">firefox-build</media:title>
		</media:content>
	</item>
		<item>
		<title>Starting the Test Suite for the GameSaver Server</title>
		<link>http://jsilver999.wordpress.com/2011/11/03/starting-the-test-suite-for-the-gamesaver-server/</link>
		<comments>http://jsilver999.wordpress.com/2011/11/03/starting-the-test-suite-for-the-gamesaver-server/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 20:34:04 +0000</pubDate>
		<dc:creator>jsilver999</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://jsilver999.wordpress.com/?p=49</guid>
		<description><![CDATA[We needed a way to test our server APIs for the GameSaver server, but I ran into the problem I talked about in an earlier post. So an idea popped into my head yesterday that node.js probably has access to command line arguments, and we could just set up the server to start in a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=49&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We needed a way to test our server APIs for the GameSaver server, but I ran into the problem I talked about in an earlier post. So an idea popped into my head yesterday that node.js probably has access to command line arguments, and we could just set up the server to start in a test mode while running our tests. Then while in the test mode, simply turn off BrowserID verification, and auto-login with &#8220;testEmail&#8221;. Since only the command line argument changes that variable to enter the test suite mode, I&#8217;m pretty sure this is safe for now. So, this did indeed work out the way I thought it would, we now have access to our server APIs in the test suite without needing to verify with BrowserID. Then, I made a simple shell script that will run the database, run the server in the testing mode, and then run all the tests. This makes just running the tests pretty painless.</p>
<p>Now other students should be able to take any other server test tickets that go up in the GameSaver Pivotal, once this gets in.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jsilver999.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jsilver999.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jsilver999.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jsilver999.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jsilver999.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jsilver999.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jsilver999.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jsilver999.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jsilver999.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jsilver999.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jsilver999.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jsilver999.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jsilver999.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jsilver999.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jsilver999.wordpress.com&#038;blog=27020133&#038;post=49&#038;subd=jsilver999&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jsilver999.wordpress.com/2011/11/03/starting-the-test-suite-for-the-gamesaver-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a428ef21aebaf6cff222e38f69d79c9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jsilver999</media:title>
		</media:content>
	</item>
	</channel>
</rss>
