/*not that easy without fixed function /// <summary> /// Select this texture as texture stage 0 /// </summary> public virtual void Select() { if (xnaTexture != null) RCGame.device.sette.DirectXDevice.SetTexture(0, xnaTexture); } // Select() */ #endregion Other #if DEBUG /* /// <summary> /// Test fullscreen texture /// </summary> //[Test] public static void TestFullscreenTextures() { Texture testTexture = null, testTexture2 = null; RaceGame.StartTest("TestFullscreenTextures", delegate { testTexture = new Texture("MainMenu.dds"); testTexture2 = new Texture("MouseCursor.dds"); }, delegate { // Fill background with crazy color RaceGame.DirectXDevice.Clear(ClearFlags.Target, Color.Aquamarine, 1, 0); // Draw texture on top of it without any alpha! RaceGame.DirectXDevice.RenderState.AlphaBlendEnable = false; testTexture.RenderOnScreen( GraphicForm.ResolutionRect, new Rectangle(0, 0, 1024, 768)); testTexture2.RenderOnScreen(new Rectangle(0, 0, testTexture2.Width, testTexture2.Height)); }); } // TestTextures() */ /// <summary> /// Test rendering rotated texture /// </summary> //[Test] public static void TestRenderingRotatedTexture() { Texture testTexture = null; TestGame.Start("TestRenderingRotatedTexture", delegate { testTexture = new Texture("landscape"); }, delegate { testTexture.RenderOnScreen( new Rectangle(0, 0, 100, 100), new Rectangle(0, 0, 100, 100)); testTexture.RenderOnScreenWithRotation( new Rectangle(100, 100, 150, 150), new Rectangle(100, 100, 150, 150), Input.MousePos.X / 100.0f, new Vector2(50, 50)); }); }
/// <summary> /// Test textures /// </summary> //[Test] public static void TestTextures() { Texture testTexture = null; TestGame.Start("TestTextures", delegate { //testTexture = new Texture("MouseCursor.dds"); testTexture = new Texture("Sun"); }, delegate { testTexture.RenderOnScreen( new Rectangle(100, 100, 256, 256), testTexture.GfxRectangle, Color.White, SpriteBlendMode.None); // Use alpha blending testTexture.RenderOnScreen( new Rectangle(Input.MousePos.X, Input.MousePos.Y, 512, 512), testTexture.GfxRectangle, new Color(64, 64, 64, 64), SpriteBlendMode.Additive); }); }
/// <summary> /// Test post screen glow on screenshot /// </summary> //[Test] public static void TestPostScreenGlowOnScreenshot() { Texture screenTexture = null; TestGame.Start("TestPostScreenGlow", 1024*2, 768*2, delegate { screenTexture = new Texture("screen03.jpg"); }, delegate { if (Input.Keyboard[Keys.Space] == KeyState.Up) BaseGame.UI.PostScreenGlowShader.Start(); screenTexture.RenderOnScreen(BaseGame.ResolutionRect); SpriteHelper.DrawAllSprites(); if (Input.Keyboard[Keys.Space] == KeyState.Up) BaseGame.UI.PostScreenGlowShader.Show(); }); }