C# Class Ypsilon.Extensions.GraphicsDeviceX

Class with extensionmethods for GraphicsDevice.
Show file Open project: ZaneDubya/YCPU

Public Methods

Method Description
PrepareScreenShot ( this device ) : void

Prepares for a screenshot by using a RenderTarget2D to write content to in Reach mode. This method should be called before your spriteBatch.Begin(), and the SaveScreenshot() method should be called after spriteBatch.End()

SaveScreenshot ( this device, string fileName = null ) : void

Create a screenshot of the current screen. You should call ScreenshotPrepare() before your spriteBatch.Begin(), and this method after spriteBatch.End();

Private Methods

Method Description
GetUnusedFileName ( ) : string
SaveScreenShotReach ( this device, string fileName = null ) : void
SaveScreenshotHiDef ( this device, string fileName = null ) : void
SaveTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, string fileName ) : void

Method Details

PrepareScreenShot() public static method

Prepares for a screenshot by using a RenderTarget2D to write content to in Reach mode. This method should be called before your spriteBatch.Begin(), and the SaveScreenshot() method should be called after spriteBatch.End()
public static PrepareScreenShot ( this device ) : void
device this The GraphicsDevice to use
return void

SaveScreenshot() public static method

Create a screenshot of the current screen. You should call ScreenshotPrepare() before your spriteBatch.Begin(), and this method after spriteBatch.End();
public static SaveScreenshot ( this device, string fileName = null ) : void
device this The GraphicsDevice to use
fileName string The filename to save to. If fileName is null - a "ScreenShot_[number].png" format is used and the screenshot is saved to the game's running directory (where the EXE is)
return void