private void CreateGraphicsContext() { var handle = new WindowInteropHelper(this).Handle; _graphicsDevice = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, GraphicsProfile.HiDef, new PresentationParameters { BackBufferWidth = Math.Max(800, 1), BackBufferHeight = Math.Max(480, 1), BackBufferFormat = SurfaceFormat.Color, DepthStencilFormat = DepthFormat.Depth24, DeviceWindowHandle = handle, PresentationInterval = PresentInterval.Immediate, IsFullScreen = false }); _monoDrawing = new MonoDrawing(_graphicsDevice); DataContext = new MainViewModel(_graphicsDevice, _monoDrawing); }
public void Initialize(StateInitDesc initDesc) { _kernel = initDesc.Kernel; _archiveManager = initDesc.ArchiveManager; _inputManager = initDesc.InputManager; _stateChange = initDesc.StateChange; drawing = new MonoDrawing(initDesc.GraphicsDevice.GraphicsDevice, initDesc.ContentManager); var viewport = initDesc.GraphicsDevice.GraphicsDevice.Viewport; drawing.SetProjection( viewport.Width, viewport.Height, Global.ResolutionWidth, Global.ResolutionHeight, 1.0f); cachedSurfaces = new Dictionary <string, IEnumerable <ISurface> >(); if (_kernel.IsReMix) { _archiveManager.LoadArchive($"menu/{_kernel.Region}/titlejf.2ld"); } _archiveManager.LoadArchive($"menu/{_kernel.Region}/title.2ld"); _archiveManager.LoadArchive($"menu/{_kernel.Region}/save.2ld"); _isTheaterModeUnlocked = false; if (_kernel.IsReMix) { if (_isTheaterModeUnlocked) { _titleLayout = ReMixTheaterTitleLayout; } else { _titleLayout = ReMixTitleLayout; } } else if (_kernel.RegionId == Constants.RegionFinalMix) { if (_isTheaterModeUnlocked) { _titleLayout = FinalMixTheaterTitleLayout; } else { _titleLayout = FinalMixTitleLayout; } } else { _titleLayout = VanillaTitleLayout; } layoutRendererBg = CreateLayoutRenderer("titl"); layoutRendererFg = CreateLayoutRenderer("titl"); layoutRendererBg.SelectedSequenceGroupIndex = _titleLayout.Copyright; if (_titleLayout.HasTheater) { layoutRendererTheater = CreateLayoutRenderer("even"); } SetOption(0); }