Example #1
0
void ExampleApp::NotifyScreenPropertiesChanged(const Eegeo::Rendering::ScreenProperties& screenProperties)
{
    m_screenPropertiesProvider.NotifyScreenPropertiesChanged(screenProperties);
    m_pCameraController->UpdateScreenProperties(screenProperties);
    
    if (m_pLoadingScreen != NULL)
    {
        m_pLoadingScreen->NotifyScreenDimensionsChanged(screenProperties.GetScreenWidth(), screenProperties.GetScreenHeight());
    }
}
Example #2
0
AppHost::AppHost(
    WindowsNativeState& nativeState,
    Eegeo::Rendering::ScreenProperties screenProperties,
    EGLDisplay display,
    EGLSurface shareSurface,
    EGLContext resourceBuildShareContext,
    bool hasNativeTouchInput,
    int maxDeviceTouchCount
)
    :m_isPaused(false)
    , m_pJpegLoader(NULL)
    , m_pWindowsLocationService(NULL)
    , m_nativeState(nativeState)
    , m_WindowsInputBoxFactory(&nativeState)
    , m_WindowsKeyboardInputFactory(&nativeState, m_inputHandler)
    , m_WindowsAlertBoxFactory(&nativeState)
    , m_WindowsNativeUIFactories(m_WindowsAlertBoxFactory, m_WindowsInputBoxFactory, m_WindowsKeyboardInputFactory)
    , m_pInputProcessor(NULL)
    , m_pWindowsPlatformAbstractionModule(NULL)
    , m_pSettingsMenuViewModule(NULL)
    , m_pSearchMenuViewModule(NULL)
    , m_pSearchResultSectionViewModule(NULL)
    , m_pModalBackgroundViewModule(NULL)
    , m_pFlattenButtonViewModule(NULL)
    , m_pMyPinCreationViewModule(NULL)
    , m_pMyPinCreationDetailsViewModule(NULL)
    , m_pMyPinDetailsViewModule(NULL)
    , m_pSearchResultPoiViewModule(NULL)
    , m_pWorldPinOnMapViewModule(NULL)
    , m_pCompassViewModule(NULL)
    , m_pApp(NULL)
    , m_pWindowsPersistentSettingsModel(NULL)
    , m_createdUIModules(false)
    , m_requestedApplicationInitialiseViewState(false)
    , m_uiCreatedMessageReceivedOnNativeThread(false)
    , m_pViewControllerUpdaterModule(NULL)
    , m_pWindowsFlurryMetricsService(NULL)
    , m_pInitialExperienceIntroViewModule(NULL)
    , m_pSurverysViewModule(NULL)
    , m_pInteriorsExplorerViewModule(NULL)
    , m_failAlertHandler(this, &AppHost::HandleStartupFailure)
    , m_pMenuReaction(NULL)
    , m_shouldStartFullscreen(false)
    , m_maxDeviceTouchCount(maxDeviceTouchCount)
{
    ASSERT_NATIVE_THREAD
         
	Eegeo_ASSERT(resourceBuildShareContext != EGL_NO_CONTEXT);

    Eegeo::TtyHandler::TtyEnabled = true;
    Eegeo::AssertHandler::BreakOnAssert = true;


    m_pWindowsLocationService = Eegeo_NEW(WindowsLocationService)(&nativeState);

    m_pJpegLoader = Eegeo_NEW(Eegeo::Helpers::Jpeg::JpegLoader)();

    std::set<std::string> customApplicationAssetDirectories;
    customApplicationAssetDirectories.insert("SearchResultOnMap");
    customApplicationAssetDirectories.insert("ApplicationConfigs");

    const ExampleApp::ApplicationConfig::ApplicationConfiguration& applicationConfiguration = ExampleApp::ApplicationConfig::SdkModel::LoadAppConfig(
        WindowsFileIO(&nativeState, customApplicationAssetDirectories),
        ExampleApp::ApplicationConfig::SdkModel::WindowsApplicationConfigurationVersionProvider(),
        ExampleApp::ApplicationConfigurationPath);

    m_shouldStartFullscreen = applicationConfiguration.ShouldStartFullscreen();

    m_pWindowsPlatformAbstractionModule = Eegeo_NEW(Eegeo::Windows::WindowsPlatformAbstractionModule)(
        nativeState,
        *m_pJpegLoader,
        display,
        resourceBuildShareContext,
        shareSurface,
        applicationConfiguration.EegeoApiKey(),
        customApplicationAssetDirectories);

    Eegeo::EffectHandler::Initialise();

    Eegeo::Windows::WindowsPlatformConfigBuilder windowsPlatformConfigBuilder(nativeState.GetDeviceModel());

    const Eegeo::Config::PlatformConfig& platformConfiguration = ExampleApp::ApplicationConfig::SdkModel::BuildPlatformConfig(windowsPlatformConfigBuilder, applicationConfiguration);

    bool enableTouchControls =  hasNativeTouchInput ? applicationConfiguration.IsKioskTouchInputEnabled() : false;

    const Eegeo::Windows::Input::WindowsInputProcessorConfig& windowsInputProcessorConfig = Eegeo::Windows::Input::WindowsInputProcessor::DefaultConfig();
    m_pInputProcessor = Eegeo_NEW(Eegeo::Windows::Input::WindowsInputProcessor)(&m_inputHandler, m_nativeState.GetWindow(), screenProperties.GetScreenWidth(), screenProperties.GetScreenHeight(), windowsInputProcessorConfig, enableTouchControls, m_maxDeviceTouchCount);

	m_pWindowsPersistentSettingsModel = Eegeo_NEW(ExampleApp::PersistentSettings::WindowsPersistentSettingsModel)(m_nativeState);

    m_pInitialExperienceModule = Eegeo_NEW(ExampleApp::InitialExperience::SdkModel::WindowsInitialExperienceModule)(
        m_nativeState,
        *m_pWindowsPersistentSettingsModel,
        m_messageBus
        );

    m_pNetworkCapabilities = Eegeo_NEW(ExampleApp::Net::SdkModel::NetworkCapabilities)(
        m_pWindowsPlatformAbstractionModule->GetConnectivityService(),
        m_pWindowsPlatformAbstractionModule->GetHttpCache(),
        *m_pWindowsPersistentSettingsModel);

    m_pWindowsFlurryMetricsService = Eegeo_NEW(ExampleApp::Metrics::WindowsFlurryMetricsService)(&m_nativeState);

    m_pMenuReaction = Eegeo_NEW(ExampleApp::Menu::View::WindowsMenuReactionModel)(false, false);


    m_pApp = Eegeo_NEW(ExampleApp::MobileExampleApp)(
        applicationConfiguration,
        *m_pWindowsPlatformAbstractionModule,
        screenProperties,
        *m_pWindowsLocationService,
        m_WindowsNativeUIFactories,
        platformConfiguration,
        *m_pJpegLoader,
        *m_pInitialExperienceModule,
        *m_pWindowsPersistentSettingsModel,
        m_messageBus,
        m_sdkDomainEventBus,
        *m_pNetworkCapabilities,
        *m_pWindowsFlurryMetricsService,        
        *this,
        *m_pMenuReaction);

    m_pModalBackgroundNativeViewModule = Eegeo_NEW(ExampleApp::ModalBackground::SdkModel::ModalBackgroundNativeViewModule)(
        m_pApp->World().GetRenderingModule(),
        m_messageBus);

    m_pSurverysViewModule = Eegeo_NEW(ExampleApp::Surveys::View::SurveyViewModule)(m_messageBus, *m_pWindowsFlurryMetricsService);

    m_pAppInputDelegate = Eegeo_NEW(AppInputDelegate)(*m_pApp);
    m_inputHandler.AddDelegateInputHandler(m_pAppInputDelegate);
}