/// <summary> /// Prepares the engine for use. This must be the first method you call on the engine. /// </summary> /// <param name="device"></param> public static void Initialize(GraphicsDevice device) { if (Device == null) { Device = device; } // setup background cell #if !SHARPDX BackgroundCell = new Texture2D(Device, 1, 1, false, SurfaceFormat.Color); #else BackgroundCell = Texture2D.New(Device, 1, 1, PixelFormat.R8G8B8A8.UInt); #endif Color[] newPixels = new Color[1]; BackgroundCell.GetData <Color>(newPixels); for (int pixel = 0; pixel < 1; pixel++) { newPixels[pixel] = Color.White; } BackgroundCell.SetData <Color>(newPixels); Fonts = new FontCollection(); ConsoleRenderStack = new Consoles.ConsoleList(); RegisterCellEffect <Effects.Blink>(); RegisterCellEffect <Effects.BlinkCharacter>(); RegisterCellEffect <Effects.ConcurrentEffect>(); RegisterCellEffect <Effects.Delay>(); RegisterCellEffect <Effects.EffectsChain>(); RegisterCellEffect <Effects.Fade>(); RegisterCellEffect <Effects.Recolor>(); }
private static void SetupFontAndEffects(string font) { Fonts = new Dictionary <string, FontMaster>(); ConsoleRenderStack = new Consoles.ConsoleList(); RegisterCellEffect <Effects.Blink>(); RegisterCellEffect <Effects.BlinkGlyph>(); RegisterCellEffect <Effects.ConcurrentEffect>(); RegisterCellEffect <Effects.Delay>(); RegisterCellEffect <Effects.EffectsChain>(); RegisterCellEffect <Effects.Fade>(); RegisterCellEffect <Effects.Recolor>(); // Load the default font and screen size DefaultFont = LoadFont(font).GetFont(Font.FontSizes.One); }