internal void SetGraphicsDevice(GraphicsDevice graphics)
		{
			//calculate a system wide unique id for the graphics device
#if XBOX360
			this.graphicsId = 999;
#else
			this.graphicsId = System.Diagnostics.Process.GetCurrentProcess().Id;
#endif
			this.screenFormat = graphics.PresentationParameters.BackBufferFormat;
			this.depthFormat = graphics.PresentationParameters.DepthStencilFormat;
			screenMultisample = (Xen.Graphics.PreferredMultiSampleLevel)graphics.PresentationParameters.MultiSampleCount;

			if (graphics != this.graphics)
				graphicsIndex++;

			this.graphicsId ^= graphicsIndex << 16;
			this.graphicsId ^= (int)(DateTime.Now.Ticks & 0xFFFF);

			this.initalised = true;
			this.graphics = graphics;

			this.windowWidth = graphics.PresentationParameters.BackBufferWidth;
			this.windowHeight = graphics.PresentationParameters.BackBufferHeight;

			//TODO: Replace
			xnaLogic.state.GetRenderState(graphics).shaderSystem.DeviceUniqueIndex = this.graphicsId;
		}
		internal void SetWindowSizeAndFormat(int width, int height, SurfaceFormat format, DepthFormat depthFormat)
		{
			this.windowWidth = width;
			this.windowHeight = height;

			this.screenFormat = format;
			this.depthFormat = depthFormat;
			screenMultisample = Xen.Graphics.PreferredMultiSampleLevel.None;
		}