Browse Source

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

setaylor 13 years ago
parent
commit
8764d28f17
1 changed files with 3 additions and 0 deletions
  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();
     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
     Node* lightNode = _scene->findNode("directionalLight");
     Light* light = lightNode->getLight();