Selaa lähdekoodia

Fixes the TemplateGame.cpp to ensure sample updates for the active aspect ratio

setaylor 13 vuotta sitten
vanhempi
sitoutus
8764d28f17
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      gameplay-template/src/TemplateGame.cpp

+ 3 - 0
gameplay-template/src/TemplateGame.cpp

@@ -15,6 +15,9 @@ void TemplateGame::initialize()
     _scene = bundle->loadScene();
     _scene = bundle->loadScene();
     SAFE_RELEASE(bundle);
     SAFE_RELEASE(bundle);
 
 
+    // Set the aspect ratio for the scene's camera to match the current resolution
+    _scene->getActiveCamera()->setAspectRatio((float)getWidth() / (float)getHeight());
+    
     // Get light node
     // Get light node
     Node* lightNode = _scene->findNode("directionalLight");
     Node* lightNode = _scene->findNode("directionalLight");
     Light* light = lightNode->getLight();
     Light* light = lightNode->getLight();