Fix camera casts

it is natural to write viewport resolutions in pixels; however, viewport
calculations are done in float coordinates. This fixes, for example,
the CoolDemo