Hi,
Thanks for sharing all your work on this engine. I have walked my way through the tutorials 1 to 3, but I am having an error at run-time over the last bit of tutorial 3:
on line 39 of the HMEngine.HMObjects.HMQuad:
36 public override void Render(GraphicsDevice myDevice)
37 {
38 myDevice.Textures[0] = Texture;
39 -> myDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, Vertices, 0, 4, Indexes, 0, 2);
40 }
the program stops and return the following error:
System.InvalidOperationException was unhandled
Message="An unexpected error has occurred."
Source="Microsoft.Xna.Framework"
StackTrace:
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.RawDrawUserIndexedPrimitives(PrimitiveType primitiveType, Int32 numVertices, Int32 primitiveCount, Void* pIndexData, _D3DFORMAT indexFormat, Void* pVertexData, Int32 vertexStride)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserIndexedPrimitives[T](PrimitiveType primitiveType, T[] vertexData, Int32 vertexOffset, Int32 numVertices, Array indexData, Int32 indexOffset, Int32 primitiveCount, _D3DFORMAT indexFormat)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserIndexedPrimitives[T](PrimitiveType primitiveType, T[] vertexData, Int32 vertexOffset, Int32 numVertices, Int32[] indexData, Int32 indexOffset, Int32 primitiveCount)
at HMEngine.HMObjects.HMQuad.Render(GraphicsDevice myDevice) in E:\source\VisualStudio2008\HMEngine\HMEngine\HMObjects\HMQuad.cs:line 39
at HMEngine.HMComponents.HMComponentManager.Draw(GameTime gameTime) in E:\source\VisualStudio2008\HMEngine\HMEngine\HMComponents\HMComponentManager.cs:line 97
at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
at HMEngine.HMGame.Draw(GameTime gameTime) in E:\source\VisualStudio2008\HMEngine\HMEngine\HMGame.cs:line 47
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 HMDemo.HMDemo.Main() in E:\source\VisualStudio2008\HMEngine\HMDemo\HMDemo.cs:line 20
InnerException:
Any pointer would be very welcome.
Tam