Multiple viewports with overlays


20-08-2008 08:32:42

I'm trying to get it to work following sinbad's recomandation here ... highlight=

however I can't get it to work. the way i'm going it is this:

Viewport v2 = Geometry.Root_.AutoCreatedWindow.AddViewport(Cam2,2,0.75f,0.0f,0.25f,0.25f);
v2.Target.PreViewportUpdate += new RenderTargetListener.PreViewportUpdateHandler(ON_v2_Target_PreViewportUpdate);
v2.Target.PostViewportUpdate += new RenderTargetListener.PostViewportUpdateHandler(ON_v2_Target_PostViewportUpdate);

Viewport v3 = Geometry.Root_.AutoCreatedWindow.AddViewport(Cam3, 3, 0.75f, 0.25f, 0.25f, 0.25f);
v3.Target.PreViewportUpdate += new RenderTargetListener.PreViewportUpdateHandler(ON_v3_Target_PreViewportUpdate);
v3.Target.PostViewportUpdate += new RenderTargetListener.PostViewportUpdateHandler(ON_v3_Target_PostViewportUpdate);

I show the overlay in PreViewportUpdate and hide it in PostViewportUpdate
The problem is that the previewportupdates for all overlays are called first and then all the postupdate functions.

call preVP1Update
call preVP2Update
call preVP3Update
call postVP1Update
call postVP2Update

Im I doing something worg?