Rendering into a Viewport

The Rmmain.cpp file calls the RenderLoop function as part of the message loop in the WinMain function. The RenderLoop function performs a few simple tasks:

·Calls IDirect3DRMFrame::Move to apply the rotations and velocities for all frames in the hierarchy.

·Calls IDirect3DRMViewport::Clear to clear the current viewport, setting it to the current background color.

·Calls IDirect3DRMViewport::Render to render the current scene into the current viewport.

·Calls IDirect3DRMDevice::Update to copy the rendered image to the display.

static BOOL RenderLoop()

{

HRESULT rval;

rval = myglobs.scene->Move(D3DVAL(1.0));

rval = myglobs.view->Clear();

rval = myglobs.view->Render(myglobs.scene);

rval = myglobs.dev->Update();

return TRUE;

}