durium
23-02-2013 10:51:03
Hello world !
I seem to have a problem with my Mogre installation, it crashes randomly !
I get this log each time :
It also seem that using a vertex buffer seem to cause the crash to occur more often...
Here is how i use my HardwareVertexBufferSharedPtr :
How can i solve this issue ? Thanks !
I seem to have a problem with my Mogre installation, it crashes randomly !
I get this log each time :
Unhandled Exception: System.AccessViolationException: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at Ogre.GpuProgramParameters.{dtor}(GpuProgramParameters* )
at Ogre.GpuProgramParameters.__delDtor(GpuProgramParameters* , UInt32 )
at Ogre.SharedPtr<Ogre::GpuProgramParameters>.{dtor}(SharedPtr<Ogre::GpuProgr
amParameters>* )
at Ogre.SharedPtr<Ogre::GpuProgramParameters>.__vecDelDtor(SharedPtr<Ogre::Gp
uProgramParameters>* , UInt32 )
at Mogre.GpuProgramParametersSharedPtr.!GpuProgramParametersSharedPtr()
at Mogre.GpuProgramParametersSharedPtr.Dispose(Boolean )
at Mogre.GpuProgramParametersSharedPtr.Finalize()
It also seem that using a vertex buffer seem to cause the crash to occur more often...
Here is how i use my HardwareVertexBufferSharedPtr :
private unsafe void removeFace(int pos) {
RenderOperation moData = new RenderOperation();
this.block.GetSection(0).GetRenderOperation(moData);
VertexElement posEl = moData.vertexData.vertexDeclaration.FindElementBySemantic(VertexElementSemantic.VES_POSITION);
HardwareVertexBufferSharedPtr vBuff = moData.vertexData.vertexBufferBinding.GetBuffer(posEl.Source);
uint size = VertexElement.GetTypeSize(VertexElementType.VET_FLOAT3);
byte* pVertex = (byte*)vBuff.Lock(HardwareBuffer.LockOptions.HBL_NORMAL) + vBuff.VertexSize * pos;
float* pReal;
for(int i = 0; i < 4; i++) {
posEl.BaseVertexPointerToElement(pVertex, &pReal);
pReal[0] = 0; pReal[1] = 0; pReal[2] = 0;
pVertex += vBuff.VertexSize;
}
vBuff.Unlock();
vBuff.Dispose();
}
How can i solve this issue ? Thanks !