BUG: Screen Resize makes Hydrax disappear

stealth977

23-01-2009 14:36:46

the following code is what i do when a screen resize happens:

void CChildView::OnSize(UINT nType, int cx, int cy)
{
m_ScreenResize = true;
CWnd::OnSize(nType, cx, cy);

CRect rect;
GetClientRect(&rect);
if (m_Window)
{
// notify "render window" instance
m_Window->windowMovedOrResized();

// Adjust camera's aspect ratio, too
if (m_Camera != 0 && rect.Width() != 0 && rect.Height() != 0)
{
m_Camera->setAspectRatio((Ogre::Real)m_Window->getWidth() / (Ogre::Real)m_Window->getHeight());
m_Camera->yaw(Radian(0));
}
}
m_ScreenResize = false;
}

It works perfect for everything in Ogre, except hydrax, the water plane disappears till next camera position change (rotation doesnt solve)

BTW: I checked with Hydrax Editor, same happens in the editor too...(Hydrax water disappears)

I am using single core 2.0GHZ laptop with 1 GB ram and Ati x600

BTW Ogre.log of the Hydrax editor: (Just the part when resize occurs)

16:30:41: !!! Direct3D Device Lost!
16:30:42: Releasing D3D9 default pool texture: Gui_Target_3
16:30:42: Released D3D9 default pool texture: Gui_Target_3
16:30:42: Releasing D3D9 default pool texture: HydraxDepthMap
16:30:42: Released D3D9 default pool texture: HydraxDepthMap
16:30:42: Releasing D3D9 default pool texture: Gui_Target_0
16:30:42: Released D3D9 default pool texture: Gui_Target_0
16:30:42: Releasing D3D9 default pool texture: Gui_Target_2
16:30:42: Released D3D9 default pool texture: Gui_Target_2
16:30:42: Releasing D3D9 default pool texture: HydraxReflectionMap
16:30:42: Released D3D9 default pool texture: HydraxReflectionMap
16:30:42: Releasing D3D9 default pool texture: Gui_Target_1
16:30:42: Released D3D9 default pool texture: Gui_Target_1
16:30:42: Releasing D3D9 default pool texture: HydraxRefractionMap
16:30:42: Released D3D9 default pool texture: HydraxRefractionMap
16:30:42: D3D9TextureManager released:
16:30:42: 7 unmanaged textures
16:30:42: D3D9HardwareBufferManager released:
16:30:42: 1 unmanaged vertex buffers
16:30:42: 0 unmanaged index buffers
16:30:42: Reset device ok w:845 h:629
16:30:42: Recreating D3D9 default pool texture: Gui_Target_3
16:30:42: Recreated D3D9 default pool texture: Gui_Target_3
16:30:42: Recreating D3D9 default pool texture: HydraxDepthMap
16:30:42: Recreated D3D9 default pool texture: HydraxDepthMap
16:30:42: Recreating D3D9 default pool texture: Gui_Target_0
16:30:42: Recreated D3D9 default pool texture: Gui_Target_0
16:30:42: Recreating D3D9 default pool texture: Gui_Target_2
16:30:42: Recreated D3D9 default pool texture: Gui_Target_2
16:30:42: Recreating D3D9 default pool texture: HydraxReflectionMap
16:30:42: Recreated D3D9 default pool texture: HydraxReflectionMap
16:30:42: Recreating D3D9 default pool texture: Gui_Target_1
16:30:42: Recreated D3D9 default pool texture: Gui_Target_1
16:30:42: Recreating D3D9 default pool texture: HydraxRefractionMap
16:30:42: Recreated D3D9 default pool texture: HydraxRefractionMap
16:30:42: D3D9TextureManager recreated:
16:30:42: 7 unmanaged textures
16:30:42: D3D9HardwareBufferManager recreated:
16:30:42: 1 unmanaged vertex buffers
16:30:42: 0 unmanaged index buffers
16:30:42: !!! Direct3D Device successfully restored.
16:30:42: [Hydrax] Restoring water mesh...
16:30:42: [Hydrax] Updating water mesh...
16:30:42: [Hydrax] Deleting water mesh...
16:30:42: [Hydrax] Water mesh deleted.
16:30:42: [Hydrax] Creating water mesh...
16:30:42: WARNING: Mesh instance 'HydraxMesh' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:30:42: [Hydrax] Water mesh created.
16:30:42: [Hydrax] Water mesh restored.

Xavyiy

24-01-2009 10:46:44

Hi stealth977!

The problem is related with the projected grid module, the fact is that when the water mesh is recreated, the mesh is repositioned to default Hydrax::mPosition attribute, and it's needed to move the camera to repositionate the mesh to the good coordinates, is this your problem?

It will be fixed for 0.5 version(about two weeks)

P.D.: I've finished my exams yesterday, so I'm back to hydrax development :)

stealth977

24-01-2009 13:40:11

Thank you very much for the answer, i am looking forward to lay my hands on v0.5 =)