Game Development Community

BUG: Dual Monitors

by Mark Joyal · in Torque X 2D · 06/03/2008 (5:23 pm) · 0 replies

Found a bug in TorqueX tonight when I dragged my game window over to my second monitor. There was a slight pause half way through the drag and then when I dropped the window it threw the following exception:

{"Cannot access a disposed object.\r\nObject name: 'RenderTarget2D'."}

at Microsoft.Xna.Framework.Helpers.CheckDisposed(Object obj, IntPtr pComPtr)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetAbstractRenderTarget(Int32 renderTargetIndex, RenderTarget renderTarget, CubeMapFace faceType)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetRenderTarget(Int32 renderTargetIndex, RenderTarget2D renderTarget)
at GarageGames.Torque.XNA.TorqueEngineComponent.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
at GarageGames.Torque.GameUtil.TorqueGame.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.Run()
at StarterGame2D.Game.Main() in C:\Users\arakiel\Documents\Visual Studio 2005\Projects\test\test\Game\Game.cs:line 45

At first I assumed that it was just something that I had done, but it turns out this happens with the default 2D Starter Game template. Just start a new one, run it, then drag the window to another monitor.

If you need anything else let me know but this seems to be a bug in TorqueX itself and not my end.

-Mark