render()//渲染函数
{
List<Mesh> Meshs = ToMesh(verts);
for (int i = 0; i < Meshs.Count; i++)
{
if (Meshs[i] != null)
{
Meshs[i].DrawSubset(0);
}
}
}执行一会,在Meshs[i].DrawSubset(0);报错:
未处理 System.AccessViolationException
Message="尝试读取或写入受保护的内存。这通常指示其他内存已损坏。"
Source="Microsoft.DirectX.Direct3DX"
StackTrace:
在 Microsoft.DirectX.Direct3D.BaseMesh.DrawSubset(Int32 attributeID)
在 MGis.FormMain.Render()
在 MGis.Program.Main()
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
{
List<Mesh> Meshs = ToMesh(verts);
for (int i = 0; i < Meshs.Count; i++)
{
if (Meshs[i] != null)
{
Meshs[i].DrawSubset(0);
}
}
}执行一会,在Meshs[i].DrawSubset(0);报错:
未处理 System.AccessViolationException
Message="尝试读取或写入受保护的内存。这通常指示其他内存已损坏。"
Source="Microsoft.DirectX.Direct3DX"
StackTrace:
在 Microsoft.DirectX.Direct3D.BaseMesh.DrawSubset(Int32 attributeID)
在 MGis.FormMain.Render()
在 MGis.Program.Main()
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货