protected override void Initialize() { Registry = new ServiceRegistry(); Registry.Register(m_SpriteBatch = new SpriteBatchExtended(this)); m_SpriteBatch.Initialize(); Registry.Register(m_InputManager = new InputManager(Window.Handle)); m_InputProvider = new InputProvider(m_InputManager); m_DisplayProvider = new DisplayProvider(m_SpriteBatch); m_Emulator = new Emulator(); m_Emulator.Initialize(m_DisplayProvider, m_InputProvider); m_Curses = new Curses(GraphicsDevice, c_ConsoleWidth, c_ConsoleHeight, c_CursesFont, true); m_Effect = new EffectState(m_SpriteBatch.LoadEffectContent("BasicEffect"), SamplerState.PointClamp); m_EffectCRT = new EffectState(m_SpriteBatch.LoadEffectContent("CRTEffect"), SamplerState.AnisotropicClamp); m_Graphics.PreferredBackBufferWidth = c_WindowW * 2; m_Graphics.PreferredBackBufferHeight = c_WindowH; m_Graphics.IsFullScreen = false; m_Graphics.ApplyChanges(); IsMouseVisible = true; base.Initialize(); SystemFunctions.SetFocus(Window.Handle); }
public GraphicsDataForDevice(SpriteBatchExtended sb, int busIndex, int width, int height) { DeviceBusIndex = busIndex; Width = width; Height = height; Texture = sb.NewTexture(Width, Height); Data = new uint[Width * Height]; }
public DisplayProvider(SpriteBatchExtended spriteBatch) { m_SpriteBatch = spriteBatch; m_Devices = new List <GraphicsDataForDevice>(); }
protected override void UnloadContent() { m_SpriteBatch.Dispose(); m_SpriteBatch = null; }