Get viewport demo code compiling in v4