How is it possible for the scene to be used in the constructor here? As far as I can see, it hasn't been instantiated anywhere, and it's not global.
I unfortunately can't compile everything to run it using VS2012 and Win8.1.
Display All
I unfortunately can't compile everything to run it using VS2012 and Win8.1.
Source Code
- //
- // HumanView::HumanView - Chapter 10, page 272
- //
- HumanView::HumanView(shared_ptr<IRenderer> renderer)
- {
- InitAudio();
- m_pProcessManager = GCC_NEW ProcessManager;
- m_PointerRadius = 1; // we assume we are on a mouse enabled machine - if this were a tablet we should detect it here.
- m_ViewId = gc_InvalidGameViewId;
- // Added post press for move, new, and destroy actor events and others
- RegisterAllDelegates();
- m_BaseGameState = BGS_Initializing; // what is the current game state
- if (renderer)
- {
- // Moved to the HumanView class post press
- m_pScene.reset(GCC_NEW ScreenElementScene(renderer));
- Frustum frustum;
- frustum.Init(GCC_PI/4.0f, 1.0f, 1.0f, 100.0f);
- m_pCamera.reset(GCC_NEW CameraNode(&Mat4x4::g_Identity, frustum));
- GCC_ASSERT(m_pScene && m_pCamera && _T("Out of memory"));
- m_pScene->VAddChild(INVALID_ACTOR_ID, m_pCamera);
- m_pScene->SetCamera(m_pCamera);
- }
- }