This method of the Direct3dRMViewport Class retrieves the width (measured in pixels) of the viewport.
public int getWidth();
Returns the width of the viewport (in pixels).