4.15 C++ Transition Guide

An Interface requires these headers with IWYU:


#include "UObject/ObjectMacros.h"
#include "UObject/Interface.h"

Also to get the Viewport size without GEngine, I have found that this works if you have access to the Player Controller pointer:



ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerController->Player);

if (!Player) { return false; }
if (!Player->ViewportClient) { return false; }

//Viewport Center
FVector2D ViewportSize;
Player->ViewportClient->GetViewportSize(ViewportSize);