/// <summary> /// Start /// </summary> /// <param name="testName">Test name</param> /// <param name="initCode">Init code</param> /// <param name="renderCode">Render code</param> public static void Start(string testName, RenderDelegate initCode, RenderDelegate renderCode) { using (Instance = new TestXNAGame(testName, initCode, renderCode)) { Instance.Run(); } }
/// <summary> /// Create test game /// </summary> /// <param name="setWindowsTitle">Set windows title</param> /// <param name="windowWidth">Window width</param> /// <param name="windowHeight">Window height</param> /// <param name="setInitCode">Set init code</param> /// <param name="setRenderCode">Set render code</param> public TestXNAGame(string setWindowsTitle, RenderDelegate setInitCode, RenderDelegate setRenderCode) { Instance = this; Instance.Window.Title = setWindowsTitle; //#if DEBUG // // Force window on top // WindowsHelper.ForceForegroundWindow( this.Window.Handle.ToInt32() ); //#endif initCode = setInitCode; renderCode = setRenderCode; }
} // Render() #region Unit Testing #if DEBUG #region TestRenderLines /// <summary> /// Test render lines /// </summary> public static void TestRenderLines() { TestXNAGame.Start("TestRenderLines", delegate { }, delegate // 3d render code { for (int num = 0; num < 200; num++) { TestXNAGame.Instance.LineManager3D.AddLine( new Vector3(-12.0f + num / 4.0f, 13.0f, 0), new Vector3(-17.0f + num / 4.0f, -13.0f, 0), new Color((byte)(255 - num), 14, (byte)num)); } // for /*TextureFont.WriteText( 2, 30, * "cam pos=" + BaseGame.CameraPos );*/ }); } // TestRenderLines()
public TestXNAGame(string nWindowsTitle) { TestXNAGame.Instance = this; Window.Title = nWindowsTitle; }
/// <summary> /// Test empty game /// </summary> public static void TestEmptyGame() { TestXNAGame.Start(null); }