Przeglądaj źródła

Updated the samples to use getAspectRatio()

Darryl Gough 13 lat temu
rodzic
commit
6258531bbc
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      gameplay-template/src/TemplateGame.cpp

+ 1 - 1
gameplay-template/src/TemplateGame.cpp

@@ -14,7 +14,7 @@ void TemplateGame::initialize()
     _scene = Scene::load("res/box.gpb");
     _scene = Scene::load("res/box.gpb");
 
 
     // Set the aspect ratio for the scene's camera to match the current resolution
     // Set the aspect ratio for the scene's camera to match the current resolution
-    _scene->getActiveCamera()->setAspectRatio((float)getWidth() / (float)getHeight());
+    _scene->getActiveCamera()->setAspectRatio(getAspectRatio());
     
     
     // Get light node
     // Get light node
     Node* lightNode = _scene->findNode("directionalLight");
     Node* lightNode = _scene->findNode("directionalLight");