Notifications
Clear all

[Closed] How to get aspect ratio of current viewport/camera?

Just wondering how do I get the aspect ratio of the current viewport/camera with
the max sdk?
Thanks
Jack

1 Reply

where ip is a pointer to the max core interface

ViewExp *vpt = ip->GetActiveViewport();
GraphicsWindow *gw = vpt->getGW();	
 int sizeX = gw->getWinSizeX();
 int sizeY = gw->getWinSizeY();
 ip->ReleaseViewport(vpt);
 float aspect = (float)sizeX/(float)sizeY;