From 2177c31d66163dba7c2fa5eb189c587dd503dda4 Mon Sep 17 00:00:00 2001 From: Glatzemann Date: Wed, 2 Nov 2011 16:36:34 +0000 Subject: [PATCH] GraphicsDeviceManager is now marked as complete by ANXStatusComparer but there are still many NotImplementedException in this class. --- ANX.Framework/GraphicsDeviceManager.cs | 137 ++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 2 deletions(-) diff --git a/ANX.Framework/GraphicsDeviceManager.cs b/ANX.Framework/GraphicsDeviceManager.cs index 34bfcd94..1abb5c69 100644 --- a/ANX.Framework/GraphicsDeviceManager.cs +++ b/ANX.Framework/GraphicsDeviceManager.cs @@ -58,13 +58,21 @@ namespace ANX.Framework { public class GraphicsDeviceManager : IGraphicsDeviceManager, IDisposable, IGraphicsDeviceService { + #region Private Members private Game game; private GraphicsDevice graphicsDevice; + public static readonly int DefaultBackBufferWidth = 800; + public static readonly int DefaultBackBufferHeight = 600; //TODO: this is 480 in the original XNA + + public event EventHandler Disposed; public event EventHandler DeviceCreated; public event EventHandler DeviceDisposing; public event EventHandler DeviceReset; public event EventHandler DeviceResetting; + public event EventHandler PreparingDeviceSettings; + + #endregion // Private Members public GraphicsDeviceManager(Game game) { @@ -95,8 +103,8 @@ namespace ANX.Framework PresentationParameters presentationParameters = new PresentationParameters(); presentationParameters.DeviceWindowHandle = game.Window.Handle; - presentationParameters.BackBufferWidth = 800; //TODO: set real default sizes - presentationParameters.BackBufferHeight = 600; + presentationParameters.BackBufferWidth = DefaultBackBufferWidth; //TODO: set real default sizes + presentationParameters.BackBufferHeight = DefaultBackBufferHeight; this.graphicsDevice = new GraphicsDevice(presentationParameters); //TODO: hookup events @@ -107,14 +115,139 @@ namespace ANX.Framework this.graphicsDevice.Present(); } + public void ApplyChanges() + { + throw new NotImplementedException(); + } + + public void ToggleFullScreen() + { + throw new NotImplementedException(); + } + public void Dispose() { throw new NotImplementedException(); } + protected GraphicsDeviceInformation FindBestDevice(bool anySuitableDevice) + { + throw new NotImplementedException(); + } + + protected virtual bool CanResetDevice(GraphicsDeviceInformation newDeviceInfo) + { + throw new NotImplementedException(); + } + + protected virtual void RankDevices(List foundDevices) + { + throw new NotImplementedException(); + } + + protected virtual void OnDeviceCreated(Object sender, EventArgs args) + { + if (DeviceCreated != null) + { + DeviceCreated(sender, args); + } + } + + protected virtual void OnDeviceDisposing(Object sender, EventArgs args) + { + if (DeviceDisposing != null) + { + DeviceDisposing(sender, args); + } + } + + protected virtual void OnDeviceReset(Object sender, EventArgs args) + { + if (DeviceReset != null) + { + DeviceReset(sender, args); + } + } + + protected virtual void OnDeviceResetting(Object sender, EventArgs args) + { + if (DeviceResetting != null) + { + DeviceResetting(sender, args); + } + } + + protected virtual void OnPreparingDeviceSettings(Object sender, PreparingDeviceSettingsEventArgs args) + { + if (PreparingDeviceSettings != null) + { + PreparingDeviceSettings(sender, args); + } + } + + protected virtual void Dispose(bool disposing + ) + { + throw new NotImplementedException(); + } + public GraphicsDevice GraphicsDevice { get { return this.graphicsDevice; } } + + public GraphicsProfile GraphicsProfile + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public DepthFormat PreferredDepthStencilFormat + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public SurfaceFormat PreferredBackBufferFormat + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public int PreferredBackBufferWidth + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public int PreferredBackBufferHeight + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public bool IsFullScreen + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public bool SynchronizeWithVerticalRetrace + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public bool PreferMultiSampling + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public DisplayOrientation SupportedOrientations + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } } }