No member named 'getWidth' in 'bs::RenderWindowProperties'


#1

Hello,
I am trying to run this code from user manual:
SPtr<RenderWindow> primaryWindow = gApplication().getPrimaryWindow();

auto& windowProps = primaryWindow->getProperties();

float aspectRatio = windowProps.getWidth() / (float)windowProps.getHeight();

camera->setAspectRatio(aspectRatio);

And I get the error: no member named ‘getWidth’ in ‘bs::RenderWindowProperties’. Can you please give me some advice so I can fix it?

Thank you!


#2

Finally I changed the third line to “float aspectRatio = windowProps.width / (float)windowProps.height;”
It works.