Wrox Programmer Forums
|
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2007, 08:57 AM
H2O H2O is offline
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
COM Exception muralidharan.d VS.NET 2002/2003 0 August 7th, 2007 02:49 PM
Exception when transforming using ksskumar XSLT 1 October 10th, 2006 02:33 AM
Exception Ochi C# 1 January 15th, 2006 11:38 PM
Security exception akibaMaila VB.NET 2002/2003 Basics 3 June 30th, 2005 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.