AliAkdurak
14-12-2010 09:50:46
Hello everyone
While trying to do printing function for our result screens I encountered a problem while trying to get a Image from the Render Windows vision. My Code goes like this:
Now this function is only called by the same thread which renders the scene. This is called by the thread from the frame started event. But it still gives an AccessViolationException. I thought it may be because the render targets contents are untouchable while in render but did not seems so now. Any Idea's where I should investigate.
RenderWindow CopyContentsToMemory AccessViolationException
Edit: Forgot to mention that Ogre.log say nothing about this exception as it is not an ogre exception hence why I think it may be because I call it with something inappropriate.
While trying to do printing function for our result screens I encountered a problem while trying to get a Image from the Render Windows vision. My Code goes like this:
public void CopyContentsToImage()
{
PixelBox pixels = new PixelBox(RenderWindow.Width, RenderWindow.Height, 1, RenderWindow.SuggestPixelFormat());
RenderWindow.CopyContentsToMemory(pixels);
unsafe
{
Result.LoadDynamicImage((byte*)pixels.data.ToPointer(), pixels.box.Width, pixels.box.Height, RenderWindow.SuggestPixelFormat());
}
ImageLoadDynamicSyncSemaphore.Release();
}
Now this function is only called by the same thread which renders the scene. This is called by the thread from the frame started event. But it still gives an AccessViolationException. I thought it may be because the render targets contents are untouchable while in render but did not seems so now. Any Idea's where I should investigate.
RenderWindow CopyContentsToMemory AccessViolationException
Edit: Forgot to mention that Ogre.log say nothing about this exception as it is not an ogre exception hence why I think it may be because I call it with something inappropriate.