Exception in DungeonQuest
Hello,
I have a problem in one of the unit tests in Dungeon Quest. When i tried to run the Unit tests ColladaModel.TestLoadStaticModel and ColladaModel.TestCaveColladaModelScene() and exception occurred, the following (in RenderVertices() of ColladaModel.cs):
InvalidOperationException : Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before draw operations may be performed.
the whole exception:
System.InvalidOperationException was unhandled
Message="Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before draw operations may be performed."
Source="Microsoft.Xna.Framework"
StackTrace:
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Ve rifyCanDraw(Boolean bUserPrimitives, Boolean bIndexedPrimitives)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Dr awIndexedPrimitives(PrimitiveType primitiveType, Int32 baseVertex, Int32 minVertexIndex, Int32 numVertices, Int32 startIndex, Int32 primitiveCount)
at DungeonQuest.Graphics.ColladaModel.RenderVertices( ) in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Graphics\ColladaModel.cs:line 908
at DungeonQuest.Shaders.ShaderEffect.RenderSinglePass Shader(Material setMat, RenderDelegate renderDelegate) in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Shaders\ShaderEffect.cs:line 779
at DungeonQuest.Graphics.ColladaModel.Render(Matrix renderMatrix) in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Graphics\ColladaModel.cs:line 891
at DungeonQuest.Graphics.ColladaModel.<>c__DisplayCla ssa.<TestLoadStaticModel>b__9() in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Graphics\ColladaModel.cs:line 1233
at DungeonQuest.Game.TestGame.Draw(GameTime gameTime) in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Game\TestGame.cs:line 95
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Paint(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameWindow.OnPaint()
at Microsoft.Xna.Framework.WindowsGameWindow.mainForm _Paint(Object sender, PaintEventArgs e)
at System.Windows.Forms.Control.OnPaint(PaintEventArg s e)
at System.Windows.Forms.Form.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at Microsoft.Xna.Framework.WindowsGameForm.WndProc(Me ssage& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at CallWindowProcW(IntPtr , HWND__* , UInt32 , UInt32 , Int32 )
at MouseSubClassFunc(HWND__* hWnd, UInt32 msg, UInt32 wParam, Int32 lParam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(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 DungeonQuest.Game.TestGame.Start(String testName, RenderDelegate initCode, RenderDelegate renderCode) in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Game\TestGame.cs:line 118
at DungeonQuest.Graphics.ColladaModel.TestLoadStaticM odel() in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Graphics\ColladaModel.cs:line 1219
at DungeonQuest.Program.Main(String[] args) in D:\BOOKS\Professional XNA Game Programming Xbox 360 Windows\Dungeon Quest\DungeonQuest\Program.cs:line 38
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
What seems to be the problem and how can i solve it ?
Thanks in advance.
|